Commit f24c1ea
authored
Surface newer server disconnect reasons as distinct DisconnectReason values (#1158)
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](https://claude.com/claude-code)1 parent 96b8d8c commit f24c1ea
4 files changed
Lines changed: 118 additions & 0 deletions
File tree
- .changes
- lib/src
- types
- test/types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
245 | 254 | | |
246 | 255 | | |
247 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
| 160 | + | |
| 161 | + | |
154 | 162 | | |
| 163 | + | |
| 164 | + | |
155 | 165 | | |
| 166 | + | |
| 167 | + | |
156 | 168 | | |
| 169 | + | |
| 170 | + | |
157 | 171 | | |
| 172 | + | |
| 173 | + | |
158 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
159 | 178 | | |
| 179 | + | |
| 180 | + | |
160 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
161 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
162 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
163 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
164 | 224 | | |
165 | 225 | | |
166 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
0 commit comments