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
- Current User is Not authorized
recreating same Thread
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...