You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it clear what arguments are expected in RTLM7, RTLM8 and improve phrasing in RTLM7*, RTLM8*, RTLM6d1a and RTLM6d1b
This uses phrasing initially added in 652daac commit
in #343 PR. It makes sense to
include those changes in this #333 PR
to make the OBJECT sync sequence and related spec items more clear.
Copy file name to clipboardExpand all lines: specifications/objects-features.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,30 +118,36 @@ Objects feature enables clients to store shared data as "objects" on a channel.
118
118
-`(RTLM6c)` Set `data` to `ObjectState.map.entries`, or to an empty map if it does not exist
119
119
-`(RTLM6d)` If `ObjectState.createOp` is present:
120
120
-`(RTLM6d1)` For each key--@ObjectsMapEntry@ pair in `ObjectState.createOp.map.entries`:
121
-
-`(RTLM6d1a)` If `ObjectsMapEntry.tombstone` is `false` or omitted, apply the `MAP_SET` operation to the specified key using `ObjectsMapEntry.timeserial` and `ObjectsMapEntry.data` per [RTLM7](#RTLM7)
122
-
-`(RTLM6d1b)` If `ObjectsMapEntry.tombstone` is `true`, apply the `MAP_REMOVE` operation to the specified key using `ObjectsMapEntry.timeserial` per[RTLM8](#RTLM8)
121
+
-`(RTLM6d1a)` If `ObjectsMapEntry.tombstone` is `false` or omitted, apply the `MAP_SET` operation to the current key as described in [RTLM7](#RTLM7), passing in `ObjectsMapEntry.data` and the current key as `ObjectsMapOp`, and `ObjectsMapEntry.timeserial` as `serial`
122
+
-`(RTLM6d1b)` If `ObjectsMapEntry.tombstone` is `true`, apply the `MAP_REMOVE` operation to the current key as described in[RTLM8](#RTLM8), passing in the current key as `ObjectsMapOp`, and `ObjectsMapEntry.timeserial` as `serial`
123
123
-`(RTLM6d2)` Set the private flag `createOperationIsMerged` to `true`
124
124
-`(RTLM7)``MAP_SET` operation for a key can be applied to a `LiveMap` in the following way:
125
+
-`(RTLM7d)` Expects the following arguments:
126
+
-`(RTLM7d1)``ObjectsMapOp`
127
+
-`(RTLM7d2)``serial` string - operation's serial value
125
128
-`(RTLM7a)` If an `ObjectsMapEntry` exists in the private `data` for the specified key:
126
129
-`(RTLM7a1)` If the operation cannot be applied to the existing entry as per [RTLM9](#RTLM9), discard the operation without taking any action
127
130
-`(RTLM7a2)` Otherwise, apply the operation to the existing entry:
128
131
-`(RTLM7a2a)` Set `ObjectsMapEntry.data` to the `ObjectData` from the operation
129
-
-`(RTLM7a2b)` Set `ObjectsMapEntry.timeserial` to the operation's serial
132
+
-`(RTLM7a2b)` Set `ObjectsMapEntry.timeserial` to the provided `serial`
130
133
-`(RTLM7a2c)` Set `ObjectsMapEntry.tombstone` to `false`
131
134
-`(RTLM7b)` If an entry does not exist in the private `data` for the specified key:
132
-
-`(RTLM7b1)` Create a new entry in `data` for the specified key with the provided `ObjectData` and the operation's serial
135
+
-`(RTLM7b1)` Create a new `ObjectsMapEntry` in `data` for the specified key, with `ObjectsMapEntry.data` set to the provided `ObjectData` and `ObjectsMapEntry.timeserial` set to `serial`
133
136
-`(RTLM7b2)` Set `ObjectsMapEntry.tombstone` for the new entry to `false`
134
137
-`(RTLM7c)` If the operation has a non-empty `ObjectData.objectId` attribute:
135
138
-`(RTLM7c1)` Create a zero-value `LiveObject` for this `ObjectData.objectId` in the internal `ObjectsPool` per [RTO6](#RTO6)
136
139
-`(RTLM8)``MAP_REMOVE` operation for a key can be applied to a `LiveMap` in the following way:
140
+
-`(RTLM8c)` Expects the following arguments:
141
+
-`(RTLM8c1)``ObjectsMapOp`
142
+
-`(RTLM8c2)``serial` string - operation's serial value
137
143
-`(RTLM8a)` If an `ObjectsMapEntry` exists in the private `data` for the specified key:
138
144
-`(RTLM8a1)` If the operation cannot be applied to the existing entry as per [RTLM9](#RTLM9), discard the operation without taking any action
139
145
-`(RTLM8a2)` Otherwise, apply the operation to the existing entry:
140
146
-`(RTLM8a2a)` Set `ObjectsMapEntry.data` to undefined/null
141
-
-`(RTLM8a2b)` Set `ObjectsMapEntry.timeserial` to the operation's serial
147
+
-`(RTLM8a2b)` Set `ObjectsMapEntry.timeserial` to the provided `serial`
142
148
-`(RTLM8a2c)` Set `ObjectsMapEntry.tombstone` to `true`
143
149
-`(RTLM8b)` If an entry does not exist in the private `data` for the specified key:
144
-
-`(RTLM8b1)` Create a new entry in `data` for the specified key, with `ObjectsMapEntry.data` set to undefined/null and the operation's serial
150
+
-`(RTLM8b1)` Create a new `ObjectsMapEntry` in `data` for the specified key, with `ObjectsMapEntry.data` set to undefined/null and `ObjectsMapEntry.timeserial` set to the provided `serial`
145
151
-`(RTLM8b2)` Set `ObjectsMapEntry.tombstone` for the new entry to `true`
146
152
-`(RTLM9)` Whether a map operation can be applied to a map entry is determined as follows:
147
153
-`(RTLM9a)` For a `LiveMap` with `semantics` set to `ObjectsMapSemantics.LWW` (Last-Write-Wins CRDT semantics), the operation must only be applied if its serial is strictly greater ("after") than the entry's serial when compared lexicographically
0 commit comments