centrifugal / centrifuge-dart

Dart (Flutter) client SDK for bidirectional communication with Centrifugo and Centrifuge-based server over WebSocket
https://pub.dartlang.org/packages/centrifuge
MIT License
102 stars 29 forks source link

ClientDisconnectedError #76

Closed furkanKotic closed 11 months ago

furkanKotic commented 1 year ago

While the application was in the foreground, the following error occurred in the log records. It wasn't in the background.

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: ClientDisconnectedError
       at Transport.sendAsyncMessage(transport.dart:155)
       at ClientImpl._onPing(client.dart:711)
       at ClientImpl._onPush(client.dart:719)
       at Transport._onData.<fn>.<fn>(transport.dart:266)
       at _GrowableList.forEach(_GrowableList.java)
       at Transport._onData.<fn>(transport.dart:262)

image

FZambia commented 1 year ago

Hello, it seems that this error is thrown when client tries to send pong to closed connection. Does the connection stops working (not reconnecting) after that?

furkanKotic commented 1 year ago

No. It works because I can still get messages even though the error occurs.

FZambia commented 1 year ago

I see, in general it's normal that connection errors happen. And if SDK successfully reconnected - then it's an expected normal behaviour. Probably we should handle and suppress this error in the SDK when sending pong 🤔

furkanKotic commented 1 year ago

It seems to be ok as the message transmission is not interrupted but it is a bit sad to see this in Firebase. I will be happy if improvement is made. thanks

BrianMwas commented 1 year ago

I am also getting the error. Though I get the following information:- Client Connecting

TomBeckett commented 1 year ago

Its something we see very often in our Sentry logging. A bit frustrating as these errors take up a lot of our Sentry allowance (50k per month) and I think we're using the Dart SDK correctly 😕

I can see this being a bit confusing to users of the SDK as when you Google this error, all results point to the SDK being used incorrectly (i.e. not connecting/reconnecting between Foreground)

FZambia commented 1 year ago

Trying to address this in #79

FZambia commented 1 year ago

Please let me know whether v0.9.4 fixes this.

TomBeckett commented 1 year ago

@FZambia We've pulled this into our app and are pushing to production soon. Will let you know if we see an improvement. We've not forgotten about it 😃

furkanKotic commented 1 year ago

Significantly reduced log records. We can say the problem is solved. Thanks 😃

FZambia commented 1 year ago

@TomBeckett hello, still waiting for the feedback about your use case, do you have any updates?