Skip to content

Commit a5273d6

Browse files
committed
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.
1 parent 9e5288a commit a5273d6

1 file changed

Lines changed: 23 additions & 14 deletions

File tree

src/objects-features.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,21 @@ the latest state.
235235
- `(RTLM6d1)` For each key–@ObjectsMapEntry@ pair in
236236
`ObjectState.createOp.map.entries`:
237237
- `(RTLM6d1a)` If `ObjectsMapEntry.tombstone` is `false` or
238-
omitted, apply the `MAP_SET` operation to the specified key
239-
using `ObjectsMapEntry.timeserial` and `ObjectsMapEntry.data`
240-
per [RTLM7](#RTLM7)
238+
omitted, apply the `MAP_SET` operation to the current key as
239+
described in [RTLM7](#RTLM7), passing in `ObjectsMapEntry.data`
240+
and the current key as `ObjectsMapOp`, and
241+
`ObjectsMapEntry.timeserial` as `serial`
241242
- `(RTLM6d1b)` If `ObjectsMapEntry.tombstone` is `true`, apply the
242-
`MAP_REMOVE` operation to the specified key using
243-
`ObjectsMapEntry.timeserial` per [RTLM8](#RTLM8)
243+
`MAP_REMOVE` operation to the current key as described in
244+
[RTLM8](#RTLM8), passing in the current key as `ObjectsMapOp`,
245+
and `ObjectsMapEntry.timeserial` as `serial`
244246
- `(RTLM6d2)` Set the private flag `createOperationIsMerged` to
245247
`true`
246248
- `(RTLM7)` `MAP_SET` operation for a key can be applied to a `LiveMap`
247249
in the following way:
250+
- `(RTLM7d)` Expects the following arguments:
251+
- `(RTLM7d1)` `ObjectsMapOp`
252+
- `(RTLM7d2)` `serial` string - operation’s serial value
248253
- `(RTLM7a)` If an `ObjectsMapEntry` exists in the private `data` for
249254
the specified key:
250255
- `(RTLM7a1)` If the operation cannot be applied to the existing
@@ -253,13 +258,14 @@ the latest state.
253258
- `(RTLM7a2)` Otherwise, apply the operation to the existing entry:
254259
- `(RTLM7a2a)` Set `ObjectsMapEntry.data` to the `ObjectData` from
255260
the operation
256-
- `(RTLM7a2b)` Set `ObjectsMapEntry.timeserial` to the operation’s
257-
serial
261+
- `(RTLM7a2b)` Set `ObjectsMapEntry.timeserial` to the provided
262+
`serial`
258263
- `(RTLM7a2c)` Set `ObjectsMapEntry.tombstone` to `false`
259264
- `(RTLM7b)` If an entry does not exist in the private `data` for the
260265
specified key:
261-
- `(RTLM7b1)` Create a new entry in `data` for the specified key
262-
with the provided `ObjectData` and the operation’s serial
266+
- `(RTLM7b1)` Create a new `ObjectsMapEntry` in `data` for the
267+
specified key, with `ObjectsMapEntry.data` set to the provided
268+
`ObjectData` and `ObjectsMapEntry.timeserial` set to `serial`
263269
- `(RTLM7b2)` Set `ObjectsMapEntry.tombstone` for the new entry to
264270
`false`
265271
- `(RTLM7c)` If the operation has a non-empty `ObjectData.objectId`
@@ -269,21 +275,24 @@ the latest state.
269275
[RTO6](#RTO6)
270276
- `(RTLM8)` `MAP_REMOVE` operation for a key can be applied to a
271277
`LiveMap` in the following way:
278+
- `(RTLM8c)` Expects the following arguments:
279+
- `(RTLM8c1)` `ObjectsMapOp`
280+
- `(RTLM8c2)` `serial` string - operation’s serial value
272281
- `(RTLM8a)` If an `ObjectsMapEntry` exists in the private `data` for
273282
the specified key:
274283
- `(RTLM8a1)` If the operation cannot be applied to the existing
275284
entry as per [RTLM9](#RTLM9), discard the operation without taking
276285
any action
277286
- `(RTLM8a2)` Otherwise, apply the operation to the existing entry:
278287
- `(RTLM8a2a)` Set `ObjectsMapEntry.data` to undefined/null
279-
- `(RTLM8a2b)` Set `ObjectsMapEntry.timeserial` to the operation’s
280-
serial
288+
- `(RTLM8a2b)` Set `ObjectsMapEntry.timeserial` to the provided
289+
`serial`
281290
- `(RTLM8a2c)` Set `ObjectsMapEntry.tombstone` to `true`
282291
- `(RTLM8b)` If an entry does not exist in the private `data` for the
283292
specified key:
284-
- `(RTLM8b1)` Create a new entry in `data` for the specified key,
285-
with `ObjectsMapEntry.data` set to undefined/null and the
286-
operation’s serial
293+
- `(RTLM8b1)` Create a new `ObjectsMapEntry` in `data` for the
294+
specified key, with `ObjectsMapEntry.data` set to undefined/null
295+
and `ObjectsMapEntry.timeserial` set to the provided `serial`
287296
- `(RTLM8b2)` Set `ObjectsMapEntry.tombstone` for the new entry to
288297
`true`
289298
- `(RTLM9)` Whether a map operation can be applied to a map entry is

0 commit comments

Comments
 (0)