Closed isandeepj closed 1 year ago
Hello @sandeep-yudiz
For now I don't have any idea where it can come from, we don't have this message inside centrifuge-swift source code. Could you provide more details:
which reason to this disconnect issue occurs not able to reconnect
- this is not very clear to me, could you elaborate more – after getting the error websocket disconnects? are you getting disconnect callback? if yes, does centrifuge-swift reconnects after disconnecting?Hello @FZambia
Version of centrifuge-swift => SwiftCentrifuge (0.5.5), Server version 3.2.0
Does this happen rarely on some devices? Or every time? Any special details you may provide?
=> Does this happen on some users devices. Maybe this data will help you!
We tracking error on the methods with try to extract data from error.
func onError(_ client: CentrifugeClient, _ event: CentrifugeErrorEvent) {
var errMsg = ""
if let centrifugeError = event.error as? CentrifugeError {
switch centrifugeError {
case .timeout:
errMsg = "timeout"
case .duplicateSub:
errMsg = "duplicateSub"
return
case .clientDisconnected:
errMsg = "clientDisconnected"
return
case .subscriptionUnsubscribed:
errMsg = "subscriptionUnsubscribed"
return
case .transportError(let err):
errMsg = "transportError: \(err.localizedDescription)"
case .tokenError(let err):
errMsg = "tokenError: \(err.localizedDescription)"
case .connectError(let err):
errMsg = "connectError: \(err.localizedDescription)"
case .refreshError(let err):
errMsg = "refreshError: \(err.localizedDescription)"
case .subscriptionSubscribeError(let err):
errMsg = "subscriptionSubscribeError: \(err.localizedDescription)"
case .subscriptionTokenError(let err):
errMsg = "subscriptionTokenError: \(err.localizedDescription)"
case .subscriptionRefreshError(let err):
errMsg = "subscriptionRefreshError: \(err.localizedDescription)"
case .replyError(let code, let message, _):
errMsg = "replyError: code: \(code) message:\(message)"
}
}
if errMsg.notEmpty {
errMsg += "; localizedDescription: \(event.error.localizedDescription)"
} else {
errMsg = event.error.localizedDescription
}
TrackingManager.sendEvent("error_centrifuge", eventProperties: ["error": errMsg])
}
Version of centrifuge-swift => SwiftCentrifuge (0.5.5), Server version 3.2.0
Starting from v0.5.0 this SDK does not support Centrifugo < v4. See release notes https://github.com/centrifugal/centrifuge-swift/releases/tag/0.5.0, and also this is stated in the README. There were many changes in protocol.
I am not sure that the error will disappear upon using proper versions – it may be normal actually as network errors happen. But probably SDK will reconnect properly.
We get onError method error type CentrifugeError.transportError
The operation couldn’t be completed. (SwiftCentrifuge.WSError error 1.)
but our app is live but not able to reproduce issue on debug mode which reason to this disconnect issue occurs not able to reconnect. so we are facing issue. did not get proper error reason so it very difficulte how to fix it this issue.If we log using this
event.error.localizedDescription
then we getThe operation couldn’t be completed. (SwiftCentrifuge.CentrifugeError error 0.)