@@ -71,6 +71,7 @@ class SocketClient: CommunicationClient {
71
71
}
72
72
73
73
var isConnected : Bool = false
74
+ private var isReconnection = false
74
75
var tearDownConnection : ( ( ) -> Void ) ?
75
76
var onClientsTerminated : ( ( ) -> Void ) ?
76
77
@@ -111,7 +112,11 @@ class SocketClient: CommunicationClient {
111
112
guard !channel. isConnected else { return }
112
113
113
114
setupClient ( )
114
- trackEvent ( . connectionRequest)
115
+ if isReconnection {
116
+ trackEvent ( . reconnectionRequest)
117
+ } else {
118
+ trackEvent ( . connectionRequest)
119
+ }
115
120
channel. connect ( )
116
121
}
117
122
@@ -129,6 +134,7 @@ class SocketClient: CommunicationClient {
129
134
private func configureSession( ) {
130
135
if let config = fetchSessionConfig ( ) , config. isValid {
131
136
channelId = config. sessionId
137
+ isReconnection = true
132
138
} else {
133
139
// purge any existing session info
134
140
store. deleteData ( for: SESSION_KEY)
@@ -185,7 +191,7 @@ private extension SocketClient {
185
191
186
192
// MARK: Clients connected event
187
193
188
- channel. on ( ClientEvent . clientsConnected ( on: channelId) ) { [ weak self ] data in
194
+ channel. on ( ClientEvent . clientsConnected ( on: channelId) ) { data in
189
195
Logging . log ( " Clients connected: \( data) " )
190
196
191
197
// for debug purposes only
0 commit comments