Commit d6ea2b8
Always attempt a resume, and let the server decide continuity
RTN14h - implemented. Replaces RTN15g as of specification 6.1.0. The client discarded
its connection state once connectionStateTtl had passed and reconnected fresh, throwing
away a resume the server would still have honoured. DF1a settles the scope - the ttl is
no longer used to decide whether to resume at all - so the gate is general rather than
SUSPENDED-only, which is how ably-js reads it too.
RTN27c - fixed. DISCONNECTED is a state where "if the library was previously connected,
the next connect attempt will be an RTN15b resume attempt". Clearing the key on every
failed attempt made that false from the second attempt onwards.
RTN8d, RTN9d - fixed twice over. Both list only CLOSED, CLOSING and FAILED, so SUSPENDED
must keep the key and id; it cleared them. And all three of the states they do name cleared
after SetState, which is what emits the state change - inline, with no SynchronizationContext
installed - so the application was told it had reached a terminal state while Connection.Key
still read as a resumable key. The clear now happens before the transition, which also stops
it depending on a finally. Only a listener reading during the transition could observe this,
so it was inherited rather than introduced here.
RTN15g1, RTN15g2, RTN15g3 - deleted at 6.1.0. HasConnectionStateTtlPassed and its tests
go with them. The reattach RTN15g3 asked for is already unconditional under RTL3d.
RTL4j, RTL4j1, RTL4j2 - deleted at 6.1.0; SDKs need not set ATTACH_RESUME. Safe only
because RTL4c1 already sends channelSerial on ATTACH and RTL15b2 keeps it across a
suspend, so the reattach still carries a continuity signal. The Flag constant stays,
per TR3f.
The now-dead clearConnectionKey parameter goes from SetDisconnectedStateCommand and
SetSuspendedStateCommand. No caller sets it, and leaving it would let the violation back
in unnoticed. SetConnectingStateCommand keeps its own, still used by ConnectionClosingState
for RTN11b/RTN11d, where a clean connection is the intent.
Two clauses the 6.1.0 edit left describing the old model. They are handled differently, and
both deliberately:
- RTN27d is not followed. It still calls SUSPENDED a state whose "next connect attempt is
a clean connection (not a resume attempt)", which RTN14h, RTN8d, RTN9d and DF1a now all
contradict; the commit that made those changes does not touch RTN27 at all. ably-js
retains the key in SUSPENDED too, citing RTN8d/RTN9d and RTN14h for it.
- RTN16g2 is followed. It says createRecoveryKey returns null in SUSPENDED, which sits
oddly beside RTN9d now that a key exists there, but it is what the published spec says
and CreateRecoveryKey still complies. ably-js returns a key instead, citing an RTN16g3
that "replaces RTN16g2 as of 6.1.0" and appears nowhere in the published spec.
Both worth raising upstream rather than guessing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 204bd6e commit d6ea2b8
10 files changed
Lines changed: 201 additions & 434 deletions
File tree
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 31 | | |
38 | 32 | | |
39 | 33 | | |
| |||
160 | 154 | | |
161 | 155 | | |
162 | 156 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 157 | + | |
| 158 | + | |
166 | 159 | | |
167 | 160 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
174 | 164 | | |
175 | 165 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 166 | + | |
| 167 | + | |
186 | 168 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
190 | 173 | | |
191 | 174 | | |
192 | 175 | | |
| |||
371 | 354 | | |
372 | 355 | | |
373 | 356 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | 357 | | |
380 | 358 | | |
381 | 359 | | |
| |||
748 | 726 | | |
749 | 727 | | |
750 | 728 | | |
751 | | - | |
752 | 729 | | |
753 | 730 | | |
754 | 731 | | |
755 | | - | |
756 | 732 | | |
757 | 733 | | |
758 | 734 | | |
| |||
792 | 768 | | |
793 | 769 | | |
794 | 770 | | |
795 | | - | |
796 | 771 | | |
797 | 772 | | |
798 | 773 | | |
| |||
Lines changed: 7 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
221 | 220 | | |
222 | 221 | | |
223 | 222 | | |
224 | | - | |
225 | | - | |
226 | 223 | | |
227 | 224 | | |
228 | 225 | | |
229 | 226 | | |
230 | 227 | | |
231 | | - | |
232 | | - | |
| 228 | + | |
233 | 229 | | |
234 | 230 | | |
235 | 231 | | |
236 | 232 | | |
237 | 233 | | |
238 | 234 | | |
239 | | - | |
240 | | - | |
241 | | - | |
| 235 | + | |
| 236 | + | |
242 | 237 | | |
243 | 238 | | |
244 | 239 | | |
245 | 240 | | |
246 | | - | |
| 241 | + | |
247 | 242 | | |
248 | 243 | | |
249 | | - | |
250 | 244 | | |
251 | 245 | | |
252 | 246 | | |
253 | 247 | | |
254 | | - | |
255 | | - | |
256 | | - | |
| 248 | + | |
257 | 249 | | |
258 | 250 | | |
259 | 251 | | |
260 | | - | |
261 | | - | |
262 | | - | |
| 252 | + | |
263 | 253 | | |
264 | 254 | | |
265 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 83 | | |
121 | 84 | | |
122 | 85 | | |
| |||
0 commit comments