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 d9af7bf. I’m assuming that the “no call” in this spec
point is a typo and means “a call”; have asked in [2].
Needed for when we integrate the room lifecycle manager into the rest of
the SDK in #47 (else there will be a crash when running the integration
tests, because a channel’s first ATTACHED status change has resumed ==
false and our precondition will fail).
[1] ably/specification#200
[2] ably/specification#200 (comment)
Copy file name to clipboardExpand all lines: Sources/AblyChat/RoomLifecycleManager.swift
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -218,6 +218,8 @@ internal actor DefaultRoomLifecycleManager<Contributor: RoomLifecycleContributor
218
218
// TODO: Not clear whether there can be multiple or just one (asked in https://github.com/ably/specification/pull/200/files#r1781927850)
logger.log(message:"Failed to attach contributor \(contributor), which is now in state \(contributorState), error \(contributorAttachError)", level:.info)
// @specPartial CHA-RL4b1 - I don’t know the meaning of "and the particular contributor has been attached previously" so haven’t implemented that part of the spec point (TODO: asked in https://github.com/ably/specification/pull/200/files#r1775552624)
973
+
// @specOneOf(1/2) CHA-RL4b1 - Tests the case where the contributor has been attached previously
// Given: A DefaultRoomLifecycleManager, with a room lifecycle operation in progress, and which has a contributor for which a CHA-RL1f call to `attach()` has succeeded
forTestingWhatHappensWhenCurrentlyIn:.attachingDueToAttachOperation(attachOperationID:UUID()), // case and ID arbitrary, just care that an operation is in progress
980
980
contributors:[contributor]
981
981
)
982
982
983
-
// When: A contributor emits an ATTACHED event with `resumed` flag set to false
983
+
// This is to satisfy "a CHA-RL1f call to `attach()` has succeeded"
984
+
tryawait manager.performAttachOperation()
985
+
986
+
// This is to put the manager into the DETACHING state, to satisfy "with a room lifecycle operation in progress"
987
+
asynclet _ = manager.performDetachOperation()
988
+
989
+
// When: The aforementioned contributor emits an ATTACHED event with `resumed` flag set to false
// Given: A DefaultRoomLifecycleManager, with a room lifecycle operation in progress, and which has a contributor for which a CHA-RL1f call to `attach()` has not previously succeeded
1017
+
letcontributor=createContributor()
1018
+
letmanager=awaitcreateManager(
1019
+
forTestingWhatHappensWhenCurrentlyIn:.attachingDueToAttachOperation(attachOperationID:UUID()), // case and ID arbitrary, just care that an operation is in progress
1020
+
contributors:[contributor]
1021
+
)
1022
+
1023
+
// When: The aforementioned contributor emits an ATTACHED event with `resumed` flag set to false
0 commit comments