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
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...