Skip to content

Commit 0516646

Browse files
committed
Clarify phrasing for spec items and fix types for serialTimestamp and tombstonedAt properties
1 parent 488e932 commit 0516646

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

textile/features.textile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ h4. ObjectMessage
15161516
** @(OM2f)@ @operation@ @ObjectOperation@ object. Mutually exclusive with the @object@ field. This field is only set on object messages if the @action@ field of the @ProtocolMessage@ encapsulating it is @OBJECT@
15171517
** @(OM2g)@ @object@ @ObjectState@ object. Mutually exclusive with the @operation@ field. This field is only set on object messages if the @action@ field of the @ProtocolMessage@ encapsulating it is @OBJECT_SYNC@
15181518
** @(OM2h)@ @serial@ string - an opaque string that uniquely identifies this object message
1519-
** @(OM2j)@ @serialTimestamp@ number - a timestamp from the @serial@ field
1519+
** @(OM2j)@ @serialTimestamp@ Time - a timestamp from the @serial@ field
15201520
** @(OM2i)@ @siteCode@ string - an opaque string used as a key to update the map of @serial@ values on an object
15211521
* @(OM3)@ The size of the @ObjectMessage@ for "TO3l8":#TO3l8 is calculated as follows:
15221522
** @(OM3a)@ The size is the sum of the sizes of the @clientId@, @operation@, @object@, and @extras@ properties
@@ -1614,7 +1614,7 @@ h4. ObjectsMapEntry
16141614
* @(OME2)@ The attributes available in an @ObjectsMapEntry@ are:
16151615
** @(OME2a)@ @tombstone@ boolean - indicates whether the map entry has been removed
16161616
** @(OME2b)@ @timeserial@ string - the @serial@#OM2h value of the last operation that was applied to the map entry
1617-
** @(OME2d)@ @serialTimestamp@ number - a timestamp from the @timeserial@ field. It is only present if @tombstone@ is @true@
1617+
** @(OME2d)@ @serialTimestamp@ Time - a timestamp from the @timeserial@ field. It is only present if @tombstone@ is @true@
16181618
** @(OME2c)@ @data@ @ObjectData@ object - the data that represents the value of the map entry.
16191619
* @(OME3)@ The size of the @ObjectsMapEntry@ is calculated as follows:
16201620
** @(OME3a)@ It is equal to the size of the @data@ property
@@ -2593,7 +2593,7 @@ class ObjectMessage // OM*, internal
25932593
operation: ObjectOperation? // OM2f
25942594
object: ObjectState? // OM2g
25952595
serial: String // OM2h
2596-
serialTimestamp: Number // OM2j
2596+
serialTimestamp: Time? // OM2j
25972597
siteCode: String // OM2i
25982598

25992599
class ObjectOperation // OOP*, internal
@@ -2632,7 +2632,7 @@ class ObjectsCounter // OCN*, internal
26322632
class ObjectsMapEntry // OME*, internal
26332633
tombstone: Boolean? // OME2a
26342634
timeserial: String? // OME2b
2635-
serialTimestamp: Number? // OME2d
2635+
serialTimestamp: Time? // OME2d
26362636
data: ObjectData // OME2c
26372637

26382638
class ObjectData // OD*, internal

textile/objects-features.textile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ h3(#liveobject). LiveObject
111111
*** @(RTLO3c1)@ Set to @false@ when the @LiveObject@ is initialized
112112
** @(RTLO3d)@ protected @isTombstone@ boolean - a flag indicating whether this object has been tombstoned, i.e. marked for deletion from the objects pool
113113
*** @(RTLO3d1)@ Set to @false@ when the @LiveObject@ is initialized
114-
** @(RTLO3e)@ protected @tombstonedAt@ number - a timestamp indicating when this object was tombstoned
114+
** @(RTLO3e)@ protected @tombstonedAt@ (optional) Time - a timestamp indicating when this object was tombstoned. This property is nullable, and is non-null if and only if @isTombstone@ is @true@
115115
*** @(RTLO3e1)@ Set to undefined/null when the @LiveObject@ is initialized
116116
* @(RTLO4)@ @LiveObject@ methods:
117117
** @(RTLO4b)@ public @subscribe@ - subscribes a user to data updates on this @LiveObject@ instance
@@ -146,7 +146,7 @@ h3(#liveobject). LiveObject
146146
*** @(RTLO4a4)@ Get the @siteSerial@ value stored for this @LiveObject@ in the @siteTimeserials@ map using the key @ObjectMessage.siteCode@
147147
*** @(RTLO4a5)@ If the @siteSerial@ for this @LiveObject@ is null or an empty string, return true
148148
*** @(RTLO4a6)@ If the @siteSerial@ for this @LiveObject@ is not an empty string, return true if @ObjectMessage.serial@ is greater than @siteSerial@ when compared lexicographically
149-
** @(RTLO4e)@ protected @tombstone@ - a convenience method used to tombstone this @LiveObject@. The realtime system reserves the right to tombstone an object (i.e. mark it for deletion from the objects pool) by publishing an @OBJECT_DELETE@ operation at any time if the object is orphaned (not a descendant of the root object) or remains uninitialized (no @CREATE@ operation has been received) for an extended period. This method describes the steps the client library must take when it needs to tombstone an object. Eventually, tombstoned objects will be garbage collected following the procedure described in "RTO10":#RTO10
149+
** @(RTLO4e)@ protected @tombstone@ - a convenience method used to tombstone this @LiveObject@. The realtime system reserves the right to tombstone an object (i.e. mark it for deletion from the objects pool) by publishing an @OBJECT_DELETE@ operation at any time if the object is orphaned (not a descendant of the root object) or remains uninitialized (no @*_CREATE@ operation has been received) for an extended period. Only the realtime system may publish an @OBJECT_DELETE@ operation; clients must never send it. This method describes the steps the client library must take when it needs to tombstone an object locally. Eventually, tombstoned objects will be garbage collected following the procedure described in "RTO10":#RTO10
150150
*** @(RTLO4e1)@ Expects the following arguments:
151151
**** @(RTLO4e1a)@ @ObjectMessage@
152152
*** @(RTLO4e2)@ Set @LiveObject.isTombstone@ to @true@
@@ -185,19 +185,19 @@ h3(#livecounter). LiveCounter
185185
** @(RTLC6d)@ If @ObjectState.createOp@ is present, merge the initial value into the @LiveCounter@ as described in "RTLC10":#RTLC10, passing in the @ObjectState.createOp@ instance
186186
*** @(RTLC6d1)@ This clause has been replaced by "RTLC10a":#RTLC10a
187187
*** @(RTLC6d2)@ This clause has been replaced by "RTLC10b":#RTLC10b
188-
* @(RTLC7)@ An @ObjectOperation@ from @ObjectMessage.operation@ can be applied to a @LiveCounter@ in the following way:
188+
* @(RTLC7)@ An @ObjectOperation@ from @ObjectMessage.operation@ can be applied to a @LiveCounter@ by performing the following actions in order:
189189
** @(RTLC7a)@ A client library may choose to implement this logic as a convenience method named @applyOperation@, which accepts an @ObjectMessage@ instance with an existing @ObjectMessage.operation@ object, with @ObjectMessage.operation.objectId@ matching the Object ID of this @LiveCounter@. This @ObjectMessage@ represents the operation to be applied to this @LiveCounter@
190-
** @(RTLC7b)@ If @ObjectMessage.operation@ cannot be applied based on the result of "@LiveObject.canApplyOperation@":#RTLO4a, log a debug or trace message indicating that the operation cannot be applied because its serial value is not newer than the object's, and discard the @ObjectMessage@ without taking any action
190+
** @(RTLC7b)@ If @ObjectMessage.operation@ cannot be applied based on the result of "@LiveObject.canApplyOperation@":#RTLO4a, log a debug or trace message indicating that the operation cannot be applied because its serial value is not newer than the object's, and discard the @ObjectMessage@ without taking any further action
191191
** @(RTLC7c)@ Set the entry in the private @siteTimeserials@ map at the key @ObjectMessage.siteCode@ to equal @ObjectMessage.serial@
192-
** @(RTLC7e)@ If @LiveCounter.isTombstone@ is @true@, the operation cannot be applied to the object. Finish processing the @ObjectMessage@ without taking any action. No data update event is emitted
192+
** @(RTLC7e)@ If @LiveCounter.isTombstone@ is @true@, the operation cannot be applied to the object. Finish processing the @ObjectMessage@ without taking any further action. No data update event is emitted
193193
** @(RTLC7d)@ The @ObjectMessage.operation.action@ field (see "@ObjectOperationAction@":../features#OOP2) determines the type of operation to apply:
194194
*** @(RTLC7d1)@ If @ObjectMessage.operation.action@ is set to @COUNTER_CREATE@, apply the operation as described in "RTLC8":#RTLC8, passing in @ObjectMessage.operation@
195195
**** @(RTLC7d1a)@ Emit the @LiveCounterUpdate@ object returned as a result of applying the operation
196196
*** @(RTLC7d2)@ If @ObjectMessage.operation.action@ is set to @COUNTER_INC@, apply the operation as described in "RTLC9":#RTLC9, passing in @ObjectMessage.operation.counterOp@
197197
**** @(RTLC7d2a)@ Emit the @LiveCounterUpdate@ object returned as a result of applying the operation
198198
*** @(RTLC7d4)@ If @ObjectMessage.operation.action@ is set to @OBJECT_DELETE@, apply the operation as described in "RTLO5":#RTLO5, passing in @ObjectMessage@
199-
**** @(RTLC7d4a)@ Emit the @LiveCounterUpdate@ object with @LiveCounterUpdate.update.amount@ set to the negative @data@ value this @LiveCounter@ had before applying the @OBJECT_DELETE@ operation
200-
*** @(RTLC7d3)@ Otherwise, log a warning that an object operation message with an unsupported action has been received, and discard the current @ObjectMessage@ without taking any action. No data update event is emitted
199+
**** @(RTLC7d4a)@ Emit a @LiveCounterUpdate@ object after applying the @OBJECT_DELETE@ operation, with @LiveCounterUpdate.update.amount@ set to the negated value that this @LiveCounter@ held before the operation was applied
200+
*** @(RTLC7d3)@ Otherwise, log a warning that an object operation message with an unsupported action has been received, and discard the current @ObjectMessage@ without taking any further action. No data update event is emitted
201201
* @(RTLC8)@ A @COUNTER_CREATE@ operation can be applied to a @LiveCounter@ in the following way:
202202
** @(RTLC8a)@ Expects the following arguments:
203203
*** @(RTLC8a1)@ @ObjectOperation@
@@ -224,7 +224,7 @@ h3(#livemap). LiveMap
224224
* @(RTLM2)@ Represents the map object type for Object IDs of type @map@
225225
* @(RTLM3)@ Holds a @Dict<String, ObjectsMapEntry>@ as a private @data@ map
226226
** @(RTLM3a)@ @ObjectsMapEntry@ entries in a @LiveMap@ have the following attributes in addition to those defined in "OME2":../features#OME2:
227-
*** @(RTLM3a1)@ @tombstonedAt@ number - a timestamp indicating when this map entry was tombstoned
227+
*** @(RTLM3a1)@ @tombstonedAt@ (optional) Time - a timestamp indicating when this map entry was tombstoned. This property is nullable, and is non-null if and only if the corresponding @ObjectsMapEntry.tombstone@ is @true@
228228
* @(RTLM4)@ The zero-value @LiveMap@ is a @LiveMap@ with @data@ set to an empty map
229229
* @(RTLM18)@ Data updates for a @LiveMap@ are emitted using the @LiveMapUpdate@ object:
230230
** @(RTLM18a)@ @LiveMapUpdate@ extends @LiveObjectUpdate@
@@ -286,11 +286,11 @@ h3(#livemap). LiveMap
286286
**** @(RTLM6d1a)@ This clause has been replaced by "RTLM17a1":#RTLM17a1
287287
**** @(RTLM6d1b)@ This clause has been replaced by "RTLM17a2":#RTLM17a2
288288
*** @(RTLM6d2)@ This clause has been replaced by "RTLM17b":#RTLM17b
289-
* @(RTLM15)@ An @ObjectOperation@ from @ObjectMessage.operation@ can be applied to a @LiveMap@ in the following way:
289+
* @(RTLM15)@ An @ObjectOperation@ from @ObjectMessage.operation@ can be applied to a @LiveMap@ by performing the following actions in order:
290290
** @(RTLM15a)@ A client library may choose to implement this logic as a convenience method named @applyOperation@, which accepts an @ObjectMessage@ instance with an existing @ObjectMessage.operation@ object, with @ObjectMessage.operation.objectId@ matching the Object ID of this @LiveMap@. This @ObjectMessage@ represents the operation to be applied to this @LiveMap@
291-
** @(RTLM15b)@ If @ObjectMessage.operation@ cannot be applied based on the result of "@LiveObject.canApplyOperation@":#RTLO4a, log a debug or trace message indicating that the operation cannot be applied because its serial value is not newer than the object's, and discard the @ObjectMessage@ without taking any action
291+
** @(RTLM15b)@ If @ObjectMessage.operation@ cannot be applied based on the result of "@LiveObject.canApplyOperation@":#RTLO4a, log a debug or trace message indicating that the operation cannot be applied because its serial value is not newer than the object's, and discard the @ObjectMessage@ without taking any further action
292292
** @(RTLM15c)@ Set the entry in the private @siteTimeserials@ map at the key @ObjectMessage.siteCode@ to equal @ObjectMessage.serial@
293-
** @(RTLM15e)@ If @LiveMap.isTombstone@ is @true@, the operation cannot be applied to the object. Finish processing the @ObjectMessage@ without taking any action. No data update event is emitted
293+
** @(RTLM15e)@ If @LiveMap.isTombstone@ is @true@, the operation cannot be applied to the object. Finish processing the @ObjectMessage@ without taking any further action. No data update event is emitted
294294
** @(RTLM15d)@ The @ObjectMessage.operation.action@ field (see "@ObjectOperationAction@":../features#OOP2) determines the type of operation to apply:
295295
*** @(RTLM15d1)@ If @ObjectMessage.operation.action@ is set to @MAP_CREATE@, apply the operation as described in "RTLM16":#RTLM16, passing in @ObjectMessage.operation@
296296
**** @(RTLM15d1a)@ Emit the @LiveMapUpdate@ object returned as a result of applying the operation
@@ -300,7 +300,7 @@ h3(#livemap). LiveMap
300300
**** @(RTLM15d3a)@ Emit the @LiveMapUpdate@ object returned as a result of applying the operation
301301
*** @(RTLM15d5)@ If @ObjectMessage.operation.action@ is set to @OBJECT_DELETE@, apply the operation as described in "RTLO5":#RTLO5, passing in @ObjectMessage@
302302
**** @(RTLM15d5a)@ Emit a @LiveMapUpdate@ object with @LiveMapUpdate.update@ consisting of entries for the keys that were removed as a result of applying the @OBJECT_DELETE@ operation, each set to @removed@
303-
*** @(RTLM15d4)@ Otherwise, log a warning that an object operation message with an unsupported action has been received, and discard the current @ObjectMessage@ without taking any action. No data update event is emitted
303+
*** @(RTLM15d4)@ Otherwise, log a warning that an object operation message with an unsupported action has been received, and discard the current @ObjectMessage@ without taking any further action. No data update event is emitted
304304
* @(RTLM16)@ A @MAP_CREATE@ operation can be applied to a @LiveMap@ in the following way:
305305
** @(RTLM16a)@ Expects the following argument:
306306
*** @(RTLM16a1)@ @ObjectOperation@
@@ -332,7 +332,7 @@ h3(#livemap). LiveMap
332332
** @(RTLM8c)@ Expects the following arguments:
333333
*** @(RTLM8c1)@ @ObjectsMapOp@
334334
*** @(RTLM8c2)@ @serial@ string - operation's serial value
335-
*** @(RTLM8c3)@ @serialTimestamp@ string - operation's serial timestamp value
335+
*** @(RTLM8c3)@ @serialTimestamp@ Time - operation's serial timestamp value
336336
** @(RTLM8d)@ The return type is a @LiveMapUpdate@ object, which indicates the data update for this @LiveMap@
337337
** @(RTLM8a)@ If an entry exists in the private @data@ for the specified key:
338338
*** @(RTLM8a1)@ If the operation cannot be applied as per "RTLM9":#RTLM9, discard the operation without taking any action. Return a @LiveMapUpdate@ object with @LiveMapUpdate.noop@ set to @true@, indicating that no update was made to the object
@@ -380,7 +380,7 @@ class LiveObject: // RTLO*
380380
siteTimeserials: Dict<String, String> // RTLO3b, internal
381381
createOperationIsMerged: Boolean // RTLO3c, internal
382382
isTombstone: Boolean // RTLO3d, internal
383-
tombstonedAt: Number // RTLO3e, internal
383+
tombstonedAt: Time? // RTLO3e, internal
384384
canApplyOperation(ObjectMessage) -> Boolean // RTLO4a, internal
385385
tombstone(ObjectMessage) // RTLO4e, internal
386386
subscribe((LiveObjectUpdate) ->) -> LiveObjectSubscription // RTLO4b

0 commit comments

Comments
 (0)