Skip to content

fix: report the waiting room for web bots - #990

Merged
noah-duncan merged 13 commits into
mainfrom
fix/waiting-room
Oct 10, 2026
Merged

noah-duncan merged 13 commits into
mainfrom
fix/waiting-room

Conversation

@rafaeljusto

@rafaeljusto rafaeljusto commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

BotStates.WAITING_ROOM and BOT_PUT_IN_WAITING_ROOM already exist and bot_controller already turns the message into a state change, but only the Zoom Native SDK adapter ever sends it — the web adapters just poll for the meeting UI. An API consumer therefore cannot tell a bot held in the lobby from one still connecting, and only learns about it when the waiting room times out.

Detect the lobby inside the Zoom Web SDK, Teams and Google Meet post-join poll loops and send the message once. The bot_controller handler now checks the bot is still JOINING, since joining -> waiting_room is a one-shot transition and create_event raises on any other source state.

To preserve existing API behavior this new behavior is gated behind a boolean env var ENABLE_WAITING_ROOM_STATE_FOR_WEB_BOTS

`BotStates.WAITING_ROOM` and `BOT_PUT_IN_WAITING_ROOM` already exist and
`bot_controller already` turns the message into a state change, but only the Zoom
adapter ever sends it — the web adapters just poll for the meeting UI. An API
consumer therefore cannot tell a bot held in the lobby from one still connecting,
and only learns about it when the waiting room times out.

Detect the lobby inside the Teams and Google Meet post-join poll loops and send
the message once. The `bot_controller` handler now checks the bot is still JOINING,
since joining -> waiting_room is a one-shot transition and create_event raises on
any other source state.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rafaeljusto

Copy link
Copy Markdown
Collaborator Author

The patch fixes one specific blind spot: Attendee.dev never tells us a bot is waiting in the lobby, so we can only ever report the failure after it's too late to do anything about it.

Concretely, today's signal timeline for a Teams meeting is:

time what Attendee tells us
T+0 joining
T+0…T+10min nothing — bot is in the lobby, state still joining
T+10min could_not_join_meeting / waiting_room_timeout_exceeded

From our side, a bot held in the lobby is indistinguishable from a bot still starting Chrome. The state machine has WAITING_ROOM, bot_controller does turn a BOT_PUT_IN_WAITING_ROOM message into a state change and a bot.state_change webhook — but only zoom_bot_adapter ever sends that message. The Teams and Meet adapters know perfectly well they're in the lobby (their own poll loops check for "Someone will let you in soon" / "Asking to be let in") and just never say so.

So the patch is about converting a 10-minute silence into an actionable event.

…tells less

restart_bot_pod bails unless the last bot event is JOIN_REQUESTED, so reporting the
waiting room made a Teams/Meet join unrecoverable: UiTeamsBlockingUsException from
the same poll loop sends BLOCKED_BY_PLATFORM_REPEATEDLY, the controller quits its
main loop and the pod is never recreated, leaving the bot to be reaped ~10 minutes
later as a fatal error. WAITING_ROOM is now a join in progress in the restart task,
in set_requested_bot_action_taken_at and in take_action_based_on_bot_in_db — which
closes the same gap for native Zoom bots, which already reached that state.

Also: the disabled prejoin join button only counts after the 30s grace period
check_if_waiting_room_connection_failed already waits out, since Teams disables it
on click and the fallback fired on direct-admit meetings; create_event re-reads the
bot in its own transaction, so catch ValidationError as well as checking the state;
and stop polling the DOM once the message has been sent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rafaeljusto
rafaeljusto marked this pull request as ready for review September 3, 2026 17:39
@rafaeljusto
rafaeljusto requested a review from a team as a code owner September 3, 2026 17:39
@noah-duncan

Copy link
Copy Markdown
Collaborator

Thanks @rafaeljusto ! We should support this. Will review and add some small changes soon, there a few minor things I'd do differently.

@noah-duncan noah-duncan changed the title fix: report the waiting room from the Teams and Google Meet adapters fix: report the waiting room from Web adapters Oct 9, 2026
@noah-duncan noah-duncan changed the title fix: report the waiting room from Web adapters fix: report the waiting room for web bots Oct 10, 2026

@noah-duncan noah-duncan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rafaeljusto !

@noah-duncan
noah-duncan merged commit 6e8ad6f into main Oct 10, 2026
21 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants