Skip to content

Commit

Permalink
Update duplicate spec points
Browse files Browse the repository at this point in the history
The duplicate spec points were renamed in commit 0e5ab98 of [1]. The
currently-implemented room lifecycle behaviour (I can’t speak for the
messages functionality) now conforms to that commit of the spec.

[1] ably/specification#200.
lawrence-forooghian committed Oct 30, 2024
1 parent 21956dc commit 20f21c7
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/AblyChat/DefaultMessages.swift
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ internal final class DefaultMessages: Messages, EmitsDiscontinuities {

// (CHA-M4c) When a realtime message with name set to message.created is received, it is translated into a message event, which contains a type field with the event type as well as a message field containing the Message Struct. This event is then broadcast to all subscribers.
// (CHA-M4d) If a realtime message with an unknown name is received, the SDK shall silently discard the message, though it may log at DEBUG or TRACE level.
// (CHA-M5d) Incoming realtime events that are malformed (unknown field should be ignored) shall not be emitted to subscribers.
// (CHA-M5k) Incoming realtime events that are malformed (unknown field should be ignored) shall not be emitted to subscribers.
channel.subscribe(MessageEvent.created.rawValue) { message in
Task {
// TODO: Revisit errors thrown as part of https://github.com/ably-labs/ably-chat-swift/issues/32
2 changes: 1 addition & 1 deletion Sources/AblyChat/RoomLifecycleManager.swift
Original file line number Diff line number Diff line change
@@ -715,7 +715,7 @@ internal actor RoomLifecycleManager<Contributor: RoomLifecycleContributor> {
break
}

// CHA-RL3c
// CHA-RL3l
changeStatus(to: .releasing(releaseOperationID: operationID))

// CHA-RL3d
4 changes: 2 additions & 2 deletions Tests/AblyChatTests/RoomLifecycleManagerTests.swift
Original file line number Diff line number Diff line change
@@ -650,7 +650,7 @@ struct RoomLifecycleManagerTests {
#expect(await contributor.channel.detachCallCount == 0)
}

// @specPartial CHA-RL3c - This is marked as specPartial because at time of writing the spec point CHA-RL3c has been accidentally duplicated to specify two separate behaviours. TODO: change this one to @spec once spec fixed (see discussion in https://github.com/ably/specification/pull/200#discussion_r1763770348)
// @spec CHA-RL3c
@Test
func release_whenReleasing() async throws {
// Given: A RoomLifecycleManager with a RELEASE lifecycle operation in progress, and hence in the RELEASING state
@@ -696,7 +696,7 @@ struct RoomLifecycleManagerTests {
#expect(await contributor.channel.detachCallCount == 1)
}

// @specPartial CHA-RL3c - Haven’t implemented the part that refers to "transient disconnect timeouts"; TODO do this (https://github.com/ably-labs/ably-chat-swift/issues/48)
// @specPartial CHA-RL3l - Haven’t implemented the part that refers to "transient disconnect timeouts"; TODO do this (https://github.com/ably-labs/ably-chat-swift/issues/48)
@Test
func release_transitionsToReleasing() async throws {
// Given: A RoomLifecycleManager, with a contributor on whom calling `detach()` will not complete until after the "Then" part of this test (the motivation for this is to suppress the room from transitioning to RELEASED, so that we can assert its current state as being RELEASING)

0 comments on commit 20f21c7

Please sign in to comment.