feat: Report bot leaving before joining - #959
Open
pylead wants to merge 1 commit into
Open
Conversation
A bot told to leave while it was still joining or sitting in the waiting room never actually joined the meeting, but it was reported the same way as a bot that left a meeting it had been in: waiting_room -(leave_requested)-> leaving -(left_meeting)-> post_processing -(post_processing_completed)-> ended It now ends in fatal_error with a could_not_join_meeting event instead: waiting_room -(leave_requested)-> leaving -(could_not_join_meeting / leave_requested_before_joining)-> fatal_error Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
rdoria1
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bot told to leave while it was still joining or waiting to be admitted looked exactly like a bot that joined and recorded the meeting (all four rows below are identical). Now it reports a failed join instead, with a new
leave_requested_before_joiningsub-type.Before
stateevent_typeevent_sub_typepost_processing→endedleft_meetingnullLEAVINGbranchpost_processing→endedleft_meetingnullLEAVE_REQUESTEDis valid fromJOININGpost_processing→endedleft_meetingnullpost_processing→endedleft_meetingnullAfter
stateevent_typeevent_sub_typefatal_errorcould_not_join_meetingleave_requested_before_joiningfatal_errorcould_not_join_meetingleave_requested_before_joiningpost_processing→endedleft_meetingnullpost_processing→endedleft_meetingnullWhile the bot is in
LEAVING, the last bot event is the leave request and itsold_stateis the state the bot was in when the leave was requested, so that's what the two cases are told apart by.LEAVINGis now also a validfromstate forCOULD_NOT_JOIN.The new sub-type is
BotEventSubTypesvalue 32 and needs a migration because it goes into thevalid_event_type_event_sub_type_combinationscheck constraint. It is deliberately notuser_requested-specific: an auto-leave (e.g. max uptime exceeded) fired from the waiting room lands here too.Billing and Slack alerts don't change — both key on
event_type == FATAL_ERROR(charges, alerts), which this isn't.Version bumped to 1.62.0 because this changes a state customers already depend on. New tests in
bots/tests/test_leave_requested_before_joining.pycover the two fixed cases plus the last two rows as regression guards.🤖 Generated with Claude Code