Commit 9243c3f
Implement updated buffer clearing rules (RTO4d, RTO4b5, RTO5a2b)
Per spec commit 997584f, buffered object operations must now be
cleared on every ATTACHED message (new RTO4d), rather than when a
new OBJECT_SYNC sequence starts (old RTO5a2b) or in the
no-HAS_OBJECTS path specifically (old RTO4b5).
The key insight is that on ATTACHED, either:
- HAS_OBJECTS is set, meaning the subsequent sync sequence includes
all operations up to the attach point, making previously buffered
operations redundant
- HAS_OBJECTS is not set, meaning the client performs an implicit
sync and clears local state anyway
Production changes:
- nosync_onChannelAttached: replace `if` with `switch` to clear
buffer on every ATTACHED (RTO4d), even when already SYNCING
- nosync_handleObjectSyncProtocolMessage: stop clearing buffer on
new sync sequence (RTO5a2b replaced by RTO4d)
Test changes:
- doesNotModifyStateWhenHasObjectsIsTrue: renamed, now asserts
buffer is cleared (RTO4d) whilst pool and sync sequence remain
unchanged
- newSequenceIdDiscardsInFlightSync: removed RTO5a2b annotation
and buffered ops assertion, now only covers RTO5a2a
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1a67249 commit 9243c3f
File tree
2 files changed
+36
-17
lines changed- Sources/AblyLiveObjects/Internal
- Tests/AblyLiveObjectsTests
2 files changed
+36
-17
lines changedLines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
| |||
728 | 739 | | |
729 | 740 | | |
730 | 741 | | |
731 | | - | |
732 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
733 | 748 | | |
734 | 749 | | |
735 | 750 | | |
| |||
743 | 758 | | |
744 | 759 | | |
745 | 760 | | |
746 | | - | |
| 761 | + | |
747 | 762 | | |
748 | 763 | | |
749 | 764 | | |
| |||
784 | 799 | | |
785 | 800 | | |
786 | 801 | | |
787 | | - | |
| 802 | + | |
| 803 | + | |
788 | 804 | | |
789 | | - | |
790 | 805 | | |
791 | 806 | | |
792 | 807 | | |
| |||
Lines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 147 | | |
156 | 148 | | |
157 | 149 | | |
| |||
175 | 167 | | |
176 | 168 | | |
177 | 169 | | |
178 | | - | |
179 | 170 | | |
180 | 171 | | |
181 | 172 | | |
| |||
366 | 357 | | |
367 | 358 | | |
368 | 359 | | |
369 | | - | |
| 360 | + | |
| 361 | + | |
370 | 362 | | |
371 | | - | |
| 363 | + | |
372 | 364 | | |
373 | 365 | | |
374 | 366 | | |
| |||
389 | 381 | | |
390 | 382 | | |
391 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
397 | | - | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
| |||
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
408 | 412 | | |
409 | 413 | | |
410 | 414 | | |
| |||
0 commit comments