I'm building a chat app, and I need to know and show to users when the subscribe connection was stablished. When I use realtime.subscribe without connection I can't detect if it succeeded or failed, because the error of connection is not dispatched to outside of the sdk.
The try catch is never fired nor the stream.onError when trying to subscribe.
This way I can't start a reconnection attempt nor show that the connection was done successfully.
Could you try to add an onError or onDone handler to listen and see if that outputs anything?
https://api.flutter.dev/flutter/dart-async/Stream/listen.html
@Steven it's what I did, it's on the screenshot attached. Neither onDone nor onError is called.
onDone is called when connection is lost. But only after successfully connected previously. But if you try subscribe already without connection, none of the methods is called.
Sorry! How did I miss that?! π«’
It might be good to create an issue in the flutter SDK repo for this
Alright
ya..perhaps we need to add some error handler here or something: https://github.com/appwrite/sdk-for-flutter/blob/f8480fdeecfb23782bd5b33d0e2a7db44fc8c391/lib/src/realtime_mixin.dart#L117
Issue created https://github.com/appwrite/sdk-for-flutter/issues/131
Recommended threads
- Bug report: Race condition in Flutter SD...
Hi team, I've found an intermittent bug in the Flutter SDK (v20.3.0) when using `createOAuth2Session` on Android. **Symptoms** After `createOAuth2Session` re...
- [SOLVED] Appwrite Cloud and FRA cloud se...
Can anyone estimate how long this will take to resolve? I am checking status here https://status.appwrite.online/
- How to use Operator.arrayAppend on a rel...
Hi, is it possible to use any operator on a relationship column? I have a One to Many relationship column on a table and I would like to add entries to the colu...