Skip to content

Surface newer server disconnect reasons as distinct DisconnectReason values - #1158

Merged
hiroshihorie merged 4 commits into
mainfrom
hiroshi/disconnect-reason-members
Aug 8, 2026
Merged

Surface newer server disconnect reasons as distinct DisconnectReason values#1158
hiroshihorie merged 4 commits into
mainfrom
hiroshi/disconnect-reason-members

Conversation

@hiroshihorie

Copy link
Copy Markdown
Member

Follow-up to #1156 (replaces #1157, which GitHub auto-closed when the stack base merged).

The protocol defines 17 disconnect reasons but the public DisconnectReason enum only had members for 8 of them, so newer reasons arriving in a leave request (for example when the server closes a room or a SIP trunk fails) were all collapsed to unknown. This adds members for the nine missing reasons and maps them in toSDKType:

migration, signalClose, roomClosed, userUnavailable, userRejected, sipTrunkFailure, connectionTimeout, mediaFailure, agentError

Unrecognized values from servers newer than the SDK still fall back to unknown via the wildcard arm introduced in #1156.

Note for apps: adding enum members means an exhaustive switch over DisconnectReason in app code will need new cases, which is why the changeset is minor.

Tests

New test/types/disconnect_reason_test.dart asserts every proto value maps to a distinct SDK value and pins the nine new mappings. Full suite passes (380 tests), analyze, format, and import sorter clean.

🤖 Generated with Claude Code

…values

The protocol defines nine disconnect reasons the public enum had no
members for, so they were all reported as unknown. Add members for them
and map them in toSDKType.
@hiroshihorie
hiroshihorie marked this pull request as ready for review August 7, 2026 11:28

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Ported from the protocol's proto comments, with the client side only
members called out explicitly and the roomClosed versus roomDeleted
distinction spelled out.
@hiroshihorie
hiroshihorie merged commit f24c1ea into main Aug 8, 2026
15 checks passed
@hiroshihorie
hiroshihorie deleted the hiroshi/disconnect-reason-members branch August 8, 2026 07:39
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.

1 participant