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
// TODO: Add the ability to statically reason about the type of pool entries in https://github.com/ably/ably-cocoa-liveobjects-plugin/issues/36
374
+
preconditionFailure("Expected map object with ID \(creationOperation.objectID) but found counter object")
375
+
}
376
+
}
377
+
378
+
// RTO11h3: Otherwise, if the object does not exist in the internal ObjectsPool:
379
+
// RTO11h3a: Create a zero-value LiveMap, set its objectId to ObjectMessage.operation.objectId, set its semantics to ObjectMessage.operation.map.semantics, and merge the initial value
380
+
letmap=InternalDefaultLiveMap.createZeroValued(
381
+
objectID: creationOperation.objectID,
382
+
semantics:.known(creationOperation.semantics),
383
+
logger: logger,
384
+
userCallbackQueue: userCallbackQueue,
385
+
clock: clock,
386
+
)
387
+
388
+
// Merge the initial value from the creation operation
// RTO11h3b: Add the created LiveMap instance to the internal ObjectsPool
392
+
entries[creationOperation.objectID]=.map(map)
393
+
394
+
// RTO11h3c: Return the created LiveMap instance
395
+
return map
396
+
}
397
+
309
398
/// Removes all entries except the root, and clears the root's data. This is to be used when an `ATTACHED` ProtocolMessage indicates that the only object in a channel is an empty root map, per RTO4b.
0 commit comments