Change in behavior to connect() function for Realtime #429
Closed
jollygreenegiant
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Option 1 sounds good to me, I don't see any use case for option 2 as it would make more sense to just call disconnect and then connect again. If you make a PR, make sure to create it based of the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@jan-tennert I'd like your thoughts on this before I make a PR -
The problem:
When I connect to a realtime channel that is already connected, it throws an
IllegalStateException
, crashing my app. This happens occasionally based on some lifecycle stuff on Android, where sometimes if you switch screens quickly, a channel may not get cleaned up entirely before trying to reconnect the next time you navigate to the screen. I think there are ways to handle this client-side by checking if the channel is subscribed first, or wrapping it in a try/catch, but thought it might be better to handle it at the library level.Options:
Any thoughts on this? Anything I'm not accounting for?
Beta Was this translation helpful? Give feedback.
All reactions