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
Add and improve logging for Messages and Reactions (+2 squashed commits)
Squashed commits:
[234cc2e] Add and improve logging for Messages and Reactions
[6697e1e] Spec complete for Presence in line with [1].
[1] - ably/specification#200
Copy file name to clipboardExpand all lines: Sources/AblyChat/DefaultMessages.swift
+21-3Lines changed: 21 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,16 +16,18 @@ internal final class DefaultMessages: Messages, EmitsDiscontinuities {
16
16
publicnonisolatedletfeatureChannel:FeatureChannel
17
17
privateletchatAPI:ChatAPI
18
18
privateletclientID:String
19
+
privateletlogger:InternalLogger
19
20
20
21
// TODO: https://github.com/ably-labs/ably-chat-swift/issues/36 - Handle unsubscribing in line with CHA-M4b
21
22
// UUID acts as a unique identifier for each listener/subscription. MessageSubscriptionWrapper houses the subscription and the timeserial of when it was attached or resumed.
// Implicitly handles channel events and therefore listners within this class. Alternative is to explicitly call something like `DefaultMessages.start()` which makes the SDK more cumbersome to interact with. This class is useless without kicking off this flow so I think leaving it here is suitable.
31
33
// "Calls to instance method 'handleChannelEvents(roomId:)' from outside of its actor context are implicitly asynchronous" hence the `await` here.
@@ -38,6 +40,7 @@ internal final class DefaultMessages: Messages, EmitsDiscontinuities {
38
40
39
41
// (CHA-M4) Messages can be received via a subscription in realtime.
// (CHA-M5a) If a subscription is added when the underlying realtime channel is ATTACHED, then the subscription point is the current channelSerial of the realtime channel.
@@ -194,12 +205,16 @@ internal final class DefaultMessages: Messages, EmitsDiscontinuities {
194
205
195
206
// Always returns the attachSerial and not the channelSerial to also serve (CHA-M5c) - If a channel leaves the ATTACHED state and then re-enters ATTACHED with resumed=false, then it must be assumed that messages have been missed. The subscription point of any subscribers must be reset to the attachSerial.
// (CHA-ER4) A user may subscribe to reaction events in Realtime.
30
31
// (CHA-ER4a) A user may provide a listener to subscribe to reaction events. This operation must have no side-effects in relation to room or underlying status. When a realtime message with name roomReaction is received, this message is converted into a reaction object and emitted to subscribers.
0 commit comments