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

**URL:** <https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512>\
**Category:** Web\
**Created:** [May 8, 2025, 12:51pm UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512 "2025-05-08T12:51:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmtruong1512](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lmtruong1512/32/59233_2.png) [@lmtruong1512](https://devforum.zoom.us/u/lmtruong1512)\
**Post date:** [May 8, 2025, 12:51pm UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/1 "2025-05-08T12:51:22Z")

</div>

**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

---

<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:** [May 9, 2025, 6:01am UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/2 "2025-05-09T06:01:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [May 9, 2025, 11:58am UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/3 "2025-05-09T11:58:02Z")

</div>

Hi @[lmtruong1512](https://devforum.zoom.us/u/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

---

<div class="post-metadata">

**Author:** ![lmtruong1512](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lmtruong1512/32/59233_2.png) [@lmtruong1512](https://devforum.zoom.us/u/lmtruong1512)\
**Post date:** [May 9, 2025, 12:28pm UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/4 "2025-05-09T12:28:04Z")

</div>

Thank @freelancer.nak, we are using the **Zoom [Video SDK](https://developers.zoom.us/docs/video-sdk)**.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [May 9, 2025, 12:52pm UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/5 "2025-05-09T12:52:44Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![lmtruong1512](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lmtruong1512/32/59233_2.png) [@lmtruong1512](https://devforum.zoom.us/u/lmtruong1512)\
**Post date:** [May 13, 2025, 3:03am UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/6 "2025-05-13T03:03:43Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![anhtv](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/anhtv/32/67823_2.png) [@anhtv](https://devforum.zoom.us/u/anhtv)\
**Post date:** [May 13, 2025, 6:41am UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/7 "2025-05-13T06:41:05Z")

</div>

@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!

---

<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:** [May 13, 2025, 6:46am UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/8 "2025-05-13T06:46:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [May 13, 2025, 8:48pm UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/9 "2025-05-13T20:48:36Z")

</div>

@lmtruong1512

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

```auto
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:

```auto
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

---

<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:** [May 13, 2026, 8:48pm UTC](https://devforum.zoom.us/t/zoom-sdk-may-not-trigger-leave-events-for-bot-on-ubuntu-headless/132512/10 "2026-05-13T20:48:38Z")

</div>

Closed on May 13, 2026, 8:48pm UTC

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