# Cannot join subsessions: Websocket closed before connection is established loop

**URL:** <https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674>\
**Category:** Web\
**Tags:** video-sdk\
**Created:** [August 19, 2025, 10:10pm UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674 "2025-08-19T22:10:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![apc](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/apc/32/70811_2.png) [@apc](https://devforum.zoom.us/u/apc)\
**Post date:** [August 19, 2025, 10:10pm UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/1 "2025-08-19T22:10:09Z")

</div>

**Description**  
I’m attempting to build a waiting room using subsessions as described in the developer blog entry “Building a telehealth waiting room with Zoom Video SDK”. If I remove all lines of code up to the `.joinSubsession` in the snippet below, the client successfully connects to the main session. As soon as I call `.joinSubsession`, the app is thrown into a connection loop that never completes. The `await .joinSubsession` promise never fulfills or rejects , and the logs indicated below begin appearing forever.

**Browser Console Error**  
WebSocket connection to ‘wss://zoomiad206247136128rwg.iad.zoom.us/wc/media/95281164371?type=s&cid=5F4E0267-5E17-E02A-6054-C58FAFBE24A9&mode=1’ failed: WebSocket is closed before the connection is established.

js\_media.min.js:2 handleRendererTypeInProps() final rendererType=3 gpuBlacklist=undefined

39e4ae1a-81b3-431e-9b27-22f0f800d9a7:1 Sharing Version: 3727

625b5454-3119-4a29-b1e2-c5017be63671:1 WebSocket connection to ‘wss://zoomiad206247136128rwg.iad.zoom.us/wc/media/95281164371?type=s&cid=08480093-56D4-2D7A-5218-DAE32DBADEBD&mode=1’ failed: WebSocket is closed before the connection is established.

js\_media.min.js:2 handleRendererTypeInProps() final rendererType=3 gpuBlacklist=undefined

da4d9623-cd77-4ca7-88a1-8ce36be7630b:1 Sharing Version: 3727

ec6ea77d-1930-4047-8f0a-1affd63d2779:1 WebSocket connection to ‘wss://zoomiad206247136128rwg.iad.zoom.us/wc/media/95281164371?type=s&cid=764B3A9D-21A0-D309-BC20-F8F670416593&mode=1’ failed: WebSocket is closed before the connection is established.

js\_media.min.js:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘remoteDescription’)

js\_media.min.js:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘remoteDescription’)

js\_media.min.js:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘remoteDescription’)

js\_media.min.js:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘remoteDescription’)

js\_media.min.js:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘setRemoteDescription’)

js\_media.min.js:2 handleRendererTypeInProps() final rendererType=3 gpuBlacklist=undefined

5dfb116a-14f9-4e3a-88f2-72010ae6abef:1 Sharing Version: 3727

8d0be545-e06c-49d1-8731-4ea0c880ae38:1

WebSocket connection to ‘wss://zoomiad206247136128rwg.iad.zoom.us/wc/media/95281164371?type=s&cid=CD4E3EE9-D9D2-0F0A-0296-76F3A1CE2FA7&mode=1’ failed: WebSocket is closed before the connection is established.

…

**Which Web Video SDK version?**  
2.2.5

**Video SDK Code Snippets**

```auto
await client.join("---", "---", "---");
        const subsessionClient = client.getSubsessionClient();
        const inProgressSubsession = (
          await subsessionClient.createSubsessions(["in-progress"])
        )[0];

        if (inProgressSubsession) {
          const ownUserId = client.getCurrentUserInfo().userId;
          const subsessionList = subsessionClient.getSubsessionList();
          const session = subsessionList.find(
            (item) => item.subsessionId === inProgressSubsession.subsessionId
          );
          if (session) {
            const { userList } = session;
            if (!userList.find((user) => user.userId == ownUserId)) {
              userList.push(client.getCurrentUserInfo());
            }
          }
          await subsessionClient.openSubsessions(subsessionList, {
            isBackToMainSessionEnabled: false,
          });
          await subsessionClient.joinSubsession(
            inProgressSubsession.subsessionId
          );
          inProgressSubsessionRef.current = inProgressSubsession;

```

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

- Device: Macbook Pro
- OS: 15.5
- Browser: Chrome
- Browser Version: 139.0.7258.67

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [August 20, 2025, 2:13am UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/2 "2025-08-20T02:13:22Z")

</div>

Hey @apc

Thanks for your feedback.

Could you share some problematic session IDs with us for troubleshooting purposes?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![apc](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/apc/32/70811_2.png) [@apc](https://devforum.zoom.us/u/apc)\
**Post date:** [August 20, 2025, 11:55am UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/3 "2025-08-20T11:55:47Z")

</div>

Yes of course, thank you @vic.yang.

I’ve just generated session ID (key) `ab026e14-6b58-4802-827d-04dc31346a0e (Dvshw1oYR8O4t3rh78zzig==)` to test this. As far as a pattern in the dashboard, every connection attempt generates a 2-3 second long participant row ie

Join Time / End Time

| 04:52:42 AM | 04:52:45 AM |
| --- | --- |
| | |

So I end up with a lot of those.

---

<div class="post-metadata">

**Author:** ![apc](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/apc/32/70811_2.png) [@apc](https://devforum.zoom.us/u/apc)\
**Post date:** [August 20, 2025, 1:14pm UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/4 "2025-08-20T13:14:03Z")

</div>

As an additional bit of info, I added this right before the join

```auto
client.on("connection-change", console.log);
          await subsessionClient.joinSubsession(
            inProgressSubsession.subsessionId
          );

```

And I see, tied to these websocket warnings, that it constantly repeats these two logs

```auto

{state: 'Connected'}

WebSocket connection to ... closed before the connection is established

{state: 'Reconnecting', reason: 'failover'}

```

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [August 21, 2025, 10:11am UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/5 "2025-08-21T10:11:10Z")

</div>

Hi @apc

> Dvshw1oYR8O4t3rh78zzig==

Thank you for sharing the session ID. We are investigating the root cause of the issue.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [August 25, 2025, 2:10am UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/6 "2025-08-25T02:10:08Z")

</div>

Hi @apc

> Dvshw1oYR8O4t3rh78zzig==

We have identified some potential causes, but we still need you to confirm some information. I will DM you with the relevant questions.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![apc](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/apc/32/70811_2.png) [@apc](https://devforum.zoom.us/u/apc)\
**Post date:** [August 26, 2025, 2:11pm UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/7 "2025-08-26T14:11:50Z")

</div>

Thanks @vic.yang , after ensuring that the token carries the `typ: JWT` header, we’re able to successfully connect. Odd that it worked for the main session without it.

Still encountering one strange thing behaviorally that I can work around for now, but seems like its not working as expected. If I `await subsessionClient.joinSession`, it never resolves. Instead, I have to subscribe to the connection change to get my code to progress.

```auto
subsessionClient.joinSubsession(inProgressSubsession.subsessionId);

            await new Promise<void>((resolve) => {
              const onConnectionChange: typeof event_connection_change = (
                payload
              ) => {
                console.log(`connection change: ${JSON.stringify(payload)}`);
                if (payload.state === ConnectionState.Connected) {
                  resolve();
                  client.off("connection-change", onConnectionChange);
                }
              };
              client.on("connection-change", onConnectionChange);
            });

```

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [August 27, 2025, 2:36am UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/8 "2025-08-27T02:36:57Z")

</div>

Hi @apc

Thanks for your feedback.

> If I `await subsessionClient.joinSession` , it never resolves.

It is indeed an issue; we will fix it in the upcoming release (2.2.10 – late August).

Thanks  
Vic

---

<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:** [August 27, 2026, 2:37am UTC](https://devforum.zoom.us/t/cannot-join-subsessions-websocket-closed-before-connection-is-established-loop/136674/9 "2026-08-27T02:37:45Z")

</div>

Closed on August 27, 2026, 2:37am UTC

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