File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
Sources/AblyLiveObjects/Internal
Tests/AblyLiveObjectsTests Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ internal struct ObjectsPool {
143143 return entry
144144 }
145145
146- /// Applies the objects gathered during an `OBJECT_SYNC` to this `ObjectsPool`, per RTO5c1.
146+ /// Applies the objects gathered during an `OBJECT_SYNC` to this `ObjectsPool`, per RTO5c1 and RTO5c2 .
147147 internal mutating func applySyncObjectsPool(
148148 _ syncObjectsPool: [ ObjectState ] ,
149149 logger: AblyPlugin . Logger ,
Original file line number Diff line number Diff line change @@ -155,9 +155,9 @@ struct InternalDefaultRealtimeObjectsTests {
155155
156156 // MARK: - RTO5c: Post-Sync Behavior Tests
157157
158- // @spec(RTO5c2, RTO5c2a) Objects not in sync are removed, except root
158+ // A smoke test that the RTO5c post- sync behaviours get performed. They are tested in more detail in the ObjectsPool.applySyncObjectsPool tests.
159159 @Test
160- func removesObjectsNotInSyncButPreservesRoot ( ) async throws {
160+ func performsPostSyncSteps ( ) async throws {
161161 let realtimeObjects = InternalDefaultRealtimeObjectsTests . createDefaultRealtimeObjects ( )
162162
163163 // Perform sync with only one object (RTO5a5 case)
@@ -172,9 +172,6 @@ struct InternalDefaultRealtimeObjectsTests {
172172 let finalPool = realtimeObjects. testsOnly_objectsPool
173173 #expect( finalPool. entries [ " root " ] != nil ) // Root preserved
174174 #expect( finalPool. entries [ " map:synced@1 " ] != nil ) // Synced object added
175-
176- // Note: We rely on applySyncObjectsPool being tested separately for RTO5c2 removal behavior
177- // as the side effect of removing pre-existing objects is tested in ObjectsPoolTests
178175 }
179176
180177 // MARK: - Error Handling Tests
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ struct ObjectsPoolTests {
204204
205205 // MARK: - RTO5c2 Tests
206206
207- // @spec(RTO5c2) Remove objects not received during sync
207+ // @spec RTO5c2
208208 @Test
209209 func removesObjectsNotInSync( ) throws {
210210 let logger = TestLogger ( )
@@ -231,7 +231,7 @@ struct ObjectsPoolTests {
231231 #expect( pool. entries [ " counter:hash@1 " ] == nil ) // Should be removed
232232 }
233233
234- // @spec(RTO5c2a) Root object must not be removed
234+ // @spec RTO5c2a
235235 @Test
236236 func doesNotRemoveRootObject( ) throws {
237237 let logger = TestLogger ( )
@@ -247,7 +247,7 @@ struct ObjectsPoolTests {
247247 #expect( pool. entries [ " map:hash@1 " ] == nil ) // Should be removed
248248 }
249249
250- // @spec(RTO5c1, RTO5c2) Complete sync scenario with mixed operations
250+ // A more complete example of the behaviours described in RTO5c1 and RTO5c2.
251251 @Test
252252 func handlesComplexSyncScenario( ) throws {
253253 let logger = TestLogger ( )
You can’t perform that action at this time.
0 commit comments