Skip to content

Commit 262384f

Browse files
committed
Temporary chat framework fixes (for tests to run without crashes/hangs).
1 parent 0805d37 commit 262384f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Sources/AblyChat/ChatClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public actor DefaultChatClient: ChatClient {
2828
}
2929

3030
public nonisolated var clientID: String {
31-
fatalError("Not yet implemented")
31+
realtime.clientId ?? "<Noname>"
3232
}
3333
}
3434

Sources/AblyChat/DefaultMessages.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ internal final class DefaultMessages: Messages, EmitsDiscontinuities {
184184
}
185185
}
186186

187+
if channel.state == .initialized {
188+
channel.attach()
189+
}
190+
187191
// (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.
188192
return try await timeserialOnChannelAttach()
189193
}

Sources/AblyChat/Errors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public enum ErrorCode: Int {
1414
/// ``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:)``.
1515
///
1616
/// TODO this code is a guess, revisit in https://github.com/ably-labs/ably-chat-swift/issues/32
17-
case inconsistentRoomOptions = 1
17+
case inconsistentRoomOptions = 40000
1818

1919
case messagesAttachmentFailed = 102_001
2020
case presenceAttachmentFailed = 102_002

0 commit comments

Comments
 (0)