Commit 10a3746
committed
Support MAP_CLEAR object operation
See DR [1], realtime implementation [2] and spec [3].
The DR specifies that MAP_CLEAR is currently only emitted by the server
for the root object. An additional decision was made that the client
should be future-proofed to support MAP_CLEAR on any map object ID,
not just root. This implementation follows that decision.
Semantics of MAP_CLEAR support:
1. OBJECT_SYNC: The clearTimeserial from the sync state is stored on
the LiveMap for use by future operations. Materialised entries
from the `ObjectMessage.object.map` arrive pre-tombstoned by the
server for entries that predated the clear. Initial entries from the
`ObjectMessage.object.createOp` are merged via the existing
MAP_SET/MAP_REMOVE semantics, which check against clearTimeserial.
2. MAP_SET: After the usual siteTimeserials check, the operation is
additionally discarded if clearTimeserial is set and is
lexicographically greater than or equal to the operation's serial,
since the set predates (or is concurrent with) the clear.
3. MAP_REMOVE: No changes needed - a remove after a clear is valid
regardless of clearTimeserial.
4. MAP_CLEAR: The operation is discarded if the current clearTimeserial
is already greater than or equal to the incoming serial (stale
clear). Otherwise, clearTimeserial is updated to the operation's
serial, and all existing entries whose timeserial is null or less
than or equal to the new clearTimeserial are tombstoned. Entries
with a strictly later timeserial are preserved.
Resolves AIT-458
[1] https://ably.atlassian.net/wiki/x/DABECAE
[2] ably/realtime#8074
[3] ably/specification#4321 parent 4f3d5e4 commit 10a3746
File tree
7 files changed
+780
-17
lines changed- src/plugins/liveobjects
- test
- common/modules
- realtime
7 files changed
+780
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1489 | 1489 | | |
1490 | 1490 | | |
1491 | 1491 | | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1492 | 1496 | | |
1493 | 1497 | | |
1494 | 1498 | | |
| |||
1500 | 1504 | | |
1501 | 1505 | | |
1502 | 1506 | | |
1503 | | - | |
| 1507 | + | |
| 1508 | + | |
1504 | 1509 | | |
1505 | 1510 | | |
1506 | 1511 | | |
| |||
1607 | 1612 | | |
1608 | 1613 | | |
1609 | 1614 | | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
1610 | 1619 | | |
1611 | 1620 | | |
1612 | 1621 | | |
| |||
1735 | 1744 | | |
1736 | 1745 | | |
1737 | 1746 | | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
1738 | 1752 | | |
1739 | 1753 | | |
1740 | 1754 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
361 | 367 | | |
362 | 368 | | |
363 | 369 | | |
| |||
366 | 372 | | |
367 | 373 | | |
368 | 374 | | |
369 | | - | |
370 | | - | |
| 375 | + | |
| 376 | + | |
371 | 377 | | |
372 | 378 | | |
373 | 379 | | |
| |||
440 | 446 | | |
441 | 447 | | |
442 | 448 | | |
| 449 | + | |
443 | 450 | | |
444 | 451 | | |
445 | 452 | | |
| |||
737 | 744 | | |
738 | 745 | | |
739 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
740 | 758 | | |
741 | 759 | | |
742 | | - | |
| 760 | + | |
743 | 761 | | |
744 | 762 | | |
745 | 763 | | |
| |||
823 | 841 | | |
824 | 842 | | |
825 | 843 | | |
| 844 | + | |
| 845 | + | |
826 | 846 | | |
827 | 847 | | |
828 | | - | |
| 848 | + | |
829 | 849 | | |
830 | 850 | | |
831 | 851 | | |
| |||
881 | 901 | | |
882 | 902 | | |
883 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
884 | 979 | | |
885 | 980 | | |
886 | 981 | | |
887 | 982 | | |
888 | 983 | | |
889 | | - | |
| 984 | + | |
890 | 985 | | |
891 | 986 | | |
892 | 987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| |||
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
230 | 242 | | |
231 | 243 | | |
232 | 244 | | |
| |||
273 | 285 | | |
274 | 286 | | |
275 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
276 | 292 | | |
277 | 293 | | |
278 | 294 | | |
| |||
487 | 503 | | |
488 | 504 | | |
489 | 505 | | |
490 | | - | |
| 506 | + | |
491 | 507 | | |
492 | 508 | | |
493 | 509 | | |
| |||
537 | 553 | | |
538 | 554 | | |
539 | 555 | | |
| 556 | + | |
540 | 557 | | |
541 | 558 | | |
542 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
| 526 | + | |
526 | 527 | | |
527 | 528 | | |
528 | 529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
190 | 205 | | |
191 | | - | |
| 206 | + | |
192 | 207 | | |
193 | 208 | | |
194 | 209 | | |
| |||
197 | 212 | | |
198 | 213 | | |
199 | 214 | | |
| 215 | + | |
200 | 216 | | |
201 | 217 | | |
202 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
0 commit comments