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
Based on [1] at 29276a5. I wrote the implementation, and for the tests
followed the development approach described in cb427d8.
[1] ably/specification#343
/// Tracks whether an object sync sequence has happened yet. This allows us to wait for a sync before returning from `getRoot()`, per RTO1c.
@@ -230,6 +233,7 @@ internal final class DefaultRealtimeObjects: RealtimeObjects, LiveMapObjectPoolD
230
233
231
234
privatestructMutableState{
232
235
internalvarobjectsPool:ObjectsPool
236
+
/// Note that we only ever populate this during a multi-`ProtocolMessage` sync sequence. It is not used in the RTO4b or RTO5a5 cases where the sync data is entirely contained within a single ProtocolMessage, because an individual ProtocolMessage is processed atomically and so no other operations that might wish to query this property can occur concurrently with the handling of these cases.
233
237
internalvarsyncSequence:SyncSequence?
234
238
internalvarsyncStatus=SyncStatus()
235
239
internalvaronChannelAttachedHasObjects:Bool?
@@ -255,7 +259,7 @@ internal final class DefaultRealtimeObjects: RealtimeObjects, LiveMapObjectPoolD
255
259
256
260
// I have, for now, not directly implemented the "perform the actions for object sync completion" of RTO4b4 since my implementation doesn't quite match the model given there; here you only have a SyncObjectsPool if you have an OBJECT_SYNC in progress, which you might not have upon receiving an ATTACHED. Instead I've just implemented what seem like the relevant side effects. Can revisit this if "the actions for object sync completion" get more complex.
257
261
258
-
// RTO4b3, RTO4b4, RTO5c3, RTO5c4
262
+
// RTO4b3, RTO4b4, RTO4b5, RTO5c3, RTO5c4, RTO5c5
259
263
syncSequence =nil
260
264
syncStatus.signalSyncComplete()
261
265
}
@@ -275,6 +279,8 @@ internal final class DefaultRealtimeObjects: RealtimeObjects, LiveMapObjectPoolD
275
279
276
280
// If populated, this contains a full set of sync data for the channel, and should be applied to the ObjectsPool.
277
281
letcompletedSyncObjectsPool:[ObjectState]?
282
+
// If populated, this contains a set of buffered inbound OBJECT messages that should be applied.
// Tests that when an OBJECT ProtocolMessage is received during a sync sequence, its operations are buffered per RTO8a and applied after sync completion per RTO5c6.
0 commit comments