# Duplicate log lines in console and unpredictable behaviour

**URL:** <https://devforum.zoom.us/t/duplicate-log-lines-in-console-and-unpredictable-behaviour/71384>\
**Category:** Web\
**Created:** [June 29, 2022, 2:42pm UTC](https://devforum.zoom.us/t/duplicate-log-lines-in-console-and-unpredictable-behaviour/71384 "2022-06-29T14:42:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![t.barry-woods](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@t.barry-woods](https://devforum.zoom.us/u/t.barry-woods)\
**Post date:** [June 29, 2022, 2:42pm UTC](https://devforum.zoom.us/t/duplicate-log-lines-in-console-and-unpredictable-behaviour/71384/1 "2022-06-29T14:42:37Z")

</div>

**Description**  
I’m using the Zoom Meeting Web SDK within a WPF WebView2 to host a zoom call in a WPF application.

I have some Javascript that is designed to programatically click the “Join Audio” button to save the user a click. This works most of the time, but on some machines, the user is presented with the “Leave Audio” button and the audio popup stays open. Given that this behaviour is unpredictable, I suspect it’s a matter of timing and perhaps a race condition within zoom’s code.

My console output shows a duplicate of every line that the Zoom Web SDK outputs, which suggests to me that it’s somehow running on 2 threads in parallel. Is that expected behaviour? Our own logging lines only appear once each, which suggests this is Zoom-specific.

**Browser Console Error**  
6e8a93aa-7ce3-403d-85e8-2c5ae297e690:1 ready to start!  
87d2e49f-5a9e-4715-b67a-c11977e37161:1 ready to start!  
0be2adbe-4794-4862-b04a-d7725f582567:1 ready to dec video!  
7c7c0464-ca89-4dcf-8794-0f889f714903:1 ready to dec video!  
87d2e49f-5a9e-4715-b67a-c11977e37161:1 JsAudioDec.js receive startMedia  
6e8a93aa-7ce3-403d-85e8-2c5ae297e690:1 JsAudioDec.js receive startMedia  
6e8a93aa-7ce3-403d-85e8-2c5ae297e690:1 Open\_Audio\_WebSocket\_Connect  
87d2e49f-5a9e-4715-b67a-c11977e37161:1 Open\_Audio\_WebSocket\_Connect  
zoom-web-sdk.js:56 Successfully joined zoom meeting Object  
zoom-web-sdk.js:104 In HideJoinAudio  
zoom-web-sdk.js:21 window.chrome Object  
zoom-web-sdk.js:24 posted message: Object  
3a198518-0070-47f1-96d7-d1935aaf8f45:1 Open\_Sharing\_WebSocket\_Connect  
4c478e1f-b788-457c-8fb0-dd1a48df0687:1 Open\_Sharing\_WebSocket\_Connect  
0be2adbe-4794-4862-b04a-d7725f582567:1 Open\_Video\_WebSocket\_Connect  
7c7c0464-ca89-4dcf-8794-0f889f714903:1 Open\_Video\_WebSocket\_Connect

**Which Web Meeting SDK version?**  
I’m using 2.1.1 for compatibility reasons - but I have tried the latest version 2.4.5 with the same results.

**Meeting SDK Code Snippets**

```auto
const onStart = () => {

    console.log("DTO in on start", this.dto);

    ZoomMtg.init({
        leaveUrl: window.location.origin + "/zoom-web-sdk/waiting-room", // window.location.href,
        screenShare: false,
        isSupportChat: false,
        isSupportQA: false,
        isSupportPolling: false,
        isSupportBreakout: false,
        isSupportCC: false,
        videoDrag: false,
        videoHeader: false,
        disablePreview: true,
        success: (success) => {
            console.log("zoom sdk init success", success);
            ZoomMtg.join({
                signature: this.dto.signature, // role in signature needs to be 0
                apiKey: this.dto.apiKey,
                meetingNumber: this.dto.meetingNumber,
                userName: this.dto.displayName,
                passWord: this.dto.password,
                success: (success) => {
                    console.log('Successfully joined zoom meeting', success);
                    ZoomMtg.getAttendeeslist({
                        success: function(res) {
                            if (res.result.attendeesList.length < 2) {
                                postMessageSafe('onUserLeave');
                                leaveCall();
                            }
                        }
                    });
                    HideJoinAudio();
                    SubscribeToMeetingEvents();
                    postMessageSafe(success);
                },
                error: (error) => {
                    console.log('failure to join zoom meeting', error);
                    postMessageSafe(error);
                }
            });
        },
        error: (error) => {
            console.log("unexpected error initing zoom meeting", error);
            postMessageSafe(error);
        }
    });
};

const HideJoinAudio = () => {
    const callback = function(mutationsList, obs) {
        const btn = document.getElementsByClassName("join-audio-by-voip__join-btn")[0];
        if (btn) {
            btn.click();
            obs.disconnect();
        }
    };

    // Create an observer instance linked to the callback function
    const observer = new MutationObserver(callback);

    // Select the node that will be observed for mutations
    const targetNode = document.getElementsByClassName("meeting-client-inner")[0];

    // Options for the observer (which mutations to observe)
    const config = { childList: true, subtree: true };
    // Start observing the target node for configured mutations
    observer.observe(targetNode, config);
};

```

**Screenshots**

 ![Screenshot 2022-06-29 at 16.33.54](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/9/c90bd9324bfa0e9e7b05c22726578c781251b245.jpeg)

**Device (please complete the following information):**

- OS: Windows 11
- Browser: WebView2 hosted in a WPF application. (Based on Edge)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 30, 2022, 12:42am UTC](https://devforum.zoom.us/t/duplicate-log-lines-in-console-and-unpredictable-behaviour/71384/2 "2022-07-30T00:42:55Z")

</div>

Closed on July 30, 2022, 12:42am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
