Zoom SDK may not trigger leave events for bot on Ubuntu (headless)

Description
I have a BOT user joining a meeting on Ubuntu using a headless browser.
On the BOT’s frontend, I’m listening for the following events to determine when it should leave the meeting:

  • user-removed
  • connection-change

However, in the meeting below, all other users left the room at 16:28, but my BOT didn’t leave until 16:43.
I would like Zoom to check whether the events above were sent to my BOT at 16:28.

  • Session ID: o4jbZ5oYRO6EcvzWjFD+Rw==
  • Meeting ID: 7229966013
  • Date/Time: 2025-04-25T16:22 (JST)
  • Username: RECORDING_BOT

Thank you for your time and support.

Which Web Video SDK version?
2.1.0

Device:

  • OS: Ubuntu
  • Browser: Chrome
  • Browser Version: 134

Hey @lmtruong1512

Thanks for your feedback.

o4jbZ5oYRO6EcvzWjFD+Rw==

Time: 2025-04-25T07:28:00 GMT

The UserID: 16782336 received user-removed event with userId: 16778240.

Thanks
Vic

1 Like

Hi @lmtruong1512,

Thanks for the detailed explanation!

Just to confirm—are you using the Zoom Meeting SDK (Web - Component View) or the Zoom Video SDK?

This will help us narrow down the issue accurately.

Best,
Naeem

1 Like

Thank @freelancer.nak, we are using the Zoom Video SDK .

Hi @lmtruong1512, thanks for the detailed explanation.

A few quick questions and suggestions to help troubleshoot this:

  1. Which client-side framework are you using (e.g., React, Vue, plain JavaScript)?
  2. Do you have any setTimeout or timeout logic implemented that might delay the bot from leaving or shutting down the headless browser process?
  3. What’s your intended behavior for the bot:
  • Should it leave when the host ends the session?
  • Should it leave if all participants leave?
  • Or should it end only when the host specifically leaves, regardless of others?

Also, please make sure that all relevant event listeners (user-added, user-updated, user-removed, connection-change, etc.) are bound after client.init() and client.createClient() but before client.join(). If the events are bound too late, the bot might miss critical session updates.

Looking forward to your response!

1 Like

@freelancer.nak Thank you for your response. We just wanted to confirm whether the BOT receives the user-removed event. Also, the additional information you provided is very helpful — thank you so much:

Please make sure that all relevant event listeners (user-added , user-updated , user-removed , connection-change , etc.) are bound after client.init() and client.createClient() but before client.join() . If the events are bound too late, the bot might miss critical session updates.

@vic.yang Hi, just a quick follow-up:
Right after receiving the user-removed event, my BOT calls getParticipantsList().
However, it seems that the removed user might still be present in the list at that moment, which prevents the BOT from detecting that it’s alone and leaving the meeting.

Could you please check whether getParticipantsList() still included the removed user(s) immediately after the user-removed event was fired around 16:28 JST?

Thanks again for your help!

Hi @anhtv

getParticipantsList()

Do you mean the client.getAllUser() method? If so, it has already removed the user who has left the session.

Thanks
Vic

@lmtruong1512

Yes, the BOT does receive the user-removed event, so make sure you’re listening for it like this:

client.on('user-removed', (data) => {
    // handle user leaving
});

As an alternative, you can periodically call getAllUsers() and compare the result with your current participant list. If a user is missing, that means they’ve left. You can use a polling interval like this:

setInterval(async () => {
    const currentUsers = await client.getAllUsers();
    // compare currentUsers with your stored participant list
}, 30000); // every 30 seconds (or 120000 for 2 minutes)

And for the current user, use getCurrentUserInfo() to track their session state reliably.

— Naeem Ahmed