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.
Summary
The user is having trouble knowing if a realtime subscription succeeded or failed when subscribing. They mention that the onError and onDone handlers are not being called when trying to subscribe without a connection. They are building a chat app and need to notify users when the subscription connection is established. A potential solution suggested is to add an onError or onDone handler to listen for any output. The user also mentions that they can't start a reconnection attempt or show that the connection was successful.
Drake
Admin
Mar 7, 2023, 23:16
Could you try to add an onError or onDone handler to listen and see if that outputs anything?
@Steven it's what I did, it's on the screenshot attached. Neither onDone nor onError is called.
fernandoxlr
Rank 2: Process
Mar 8, 2023, 12:51
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.
Drake
Admin
Mar 8, 2023, 14:36
Sorry! How did I miss that?! 🫢
Drake
Admin
Mar 8, 2023, 14:37
It might be good to create an issue in the flutter SDK repo for this