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
@@ -41,43 +40,14 @@ internal final class DefaultConnection: Connection {
41
40
retryIn: stateChange.retryIn,
42
41
)
43
42
44
-
letisTimerRunning= timerManager.hasRunningTask()
45
-
// (CHA-CS5a) The chat client must suppress transient disconnection events. It is not uncommon for Ably servers to perform connection shedding to balance load, or due to retiring. Clients should not need to concern themselves with transient events.
46
-
47
-
// (CHA-CS5a2) If a transient disconnect timer is active and the realtime connection status changes to `DISCONNECTED` or `CONNECTING`, the library must not emit a status change.
48
-
if isTimerRunning, currentState ==.disconnected || currentState ==.connecting {
49
-
return
50
-
}
51
-
52
-
// (CHA-CS5a3) If a transient disconnect timer is active and the realtime connections status changes to `CONNECTED`, `SUSPENDED` or `FAILED`, the library shall cancel the transient disconnect timer. The superseding status change shall be emitted.
// (CHA-CS5a1) If the realtime connection status transitions from `CONNECTED` to `DISCONNECTED`, the chat client connection status must not change. A 5 second transient disconnect timer shall be started.
59
-
if previousState ==.connected, currentState ==.disconnected, !isTimerRunning {
// (CHA-CS5a4) If a transient disconnect timer expires the library shall emit a connection status change event. This event must contain the current status of of timer expiry, along with the original error that initiated the transient disconnect timer.
62
-
timerManager.cancelTimer()
63
-
callback(statusChange)
64
-
}
65
-
return
66
-
}
67
-
68
-
if isTimerRunning {
69
-
timerManager.cancelTimer()
70
-
}
71
-
72
-
// (CHA-CS5b) Not withstanding CHA-CS5a. If a connection state event is observed from the underlying realtime library, the client must emit a status change event. The current status of that event shall reflect the status change in the underlying realtime library, along with the accompanying error.
43
+
// (CHA-CS5c) The current status of that event shall reflect the status change in the underlying realtime library, along with the accompanying error.
0 commit comments