Skip to content

Commit

Permalink
Temporary chat framework fixes (for tests to run without crashes/hangs).
Browse files Browse the repository at this point in the history
  • Loading branch information
maratal committed Nov 17, 2024
1 parent 5ecbcb9 commit 80775eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/AblyChat/ChatClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public actor DefaultChatClient: ChatClient {
}

public nonisolated var clientID: String {
fatalError("Not yet implemented")
realtime.clientId ?? "<Noname>"
}
}

Expand Down
4 changes: 4 additions & 0 deletions Sources/AblyChat/DefaultMessages.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ internal final class DefaultMessages: Messages, EmitsDiscontinuities {
}
}

if channel.state == .initialized {
channel.attach()
}

// (CHA-M5b) If a subscription is added when the underlying realtime channel is in any other state, then its subscription point becomes the attachSerial at the the point of channel attachment.
return try await timeserialOnChannelAttach()
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/AblyChat/Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum ErrorCode: Int {
/// ``Rooms.get(roomID:options:)`` was called with a different set of room options than was used on a previous call. You must first release the existing room instance using ``Rooms.release(roomID:)``.
///
/// TODO this code is a guess, revisit in https://github.com/ably-labs/ably-chat-swift/issues/32
case inconsistentRoomOptions = 1
case inconsistentRoomOptions = 40000

case messagesAttachmentFailed = 102_001
case presenceAttachmentFailed = 102_002
Expand Down

0 comments on commit 80775eb

Please sign in to comment.