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
- Flutter OAuth2 webAuth Bug?
I created with flutter an app where I can login in with my Microsoft Account. When I compile it to Web (WASM) or Android (aab) then there is no problem what so ...
- Synchronous Function Execution Timed Out...
Hi Appwrite team 👋 I’m facing a synchronous function execution timeout issue on Appwrite Cloud and would appreciate some guidance. I executed this function u...
- Push Notification FCM Error
Hello dear people. I tried to integrate Push Notifications into my Flutter App. Everything works fine on Android/iOS Simulator + Testflight but as soon as I s...