-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realtime connection unable to reconnect after TIMED_OUT #1088
Comments
i'm resorting to this for now, not sure if its gonna have any performance implications on the server
|
@farzd I too have the issue that my customers tell me some values are not updated anymore, which for me is clearly because of broken realtime connections. When testing locally, it seem to always reconnect after the app was in background or the network connection was interrupted, thought. Were you able to fix your issue using the foreground change listener above? |
@flogy i've raised a ticket and the team got back to me. [10th July]
i'm finding that the reconnect on app foregrounding appears to be functioning faster / better than maintaining the same connection, mentioned above: #1088 (comment) |
Hey @filipecabaco , thanks for the fix on this PR: supabase/realtime-js#121 Does this provide any benefit to running Supabase in a mobile app that gets backgrounded? If not, do you have any suggestions on how to use Supabase realtime in the mobile environment? Thanks! |
Bug report
Describe the bug
When the realtime connection is lost on a native iOS/Android device [using Expo], attempting to auto reconnect always results in a loop. Keeps disconnecting after a reconnect.
To Reproduce
After a successful SUBSCRIBED subscription status, minimise the mobile app and lock the phone for 3 seconds.
After reverting back to the app you should get two CHANNEL_ERROR subscription statuses
[If you stay in the app, supabase manages to reconnect most of the time automatically]
But if you repeat the process before this reconnection and minimise the mobile app and lock the phone for 3 seconds. Reverting back to the app results in two more CHANNEL_ERROR subscription statuses. Followed by a CLOSED. After 10 seconds this results in a TIMED_OUT. if you start the reconnection process within this 10 seconds - the subscription fluctuates between SUBSCRIBED and CLOSED in a loop
Expected behavior
After CLOSED, the user defined reconnection strategy should result in a successful SUBSCRIBED state.
This works if i manually disconnect [the disconnect button at the top in the screenshot triggers a removeChannel call for the active subscription ]
Screenshots
[see status log in the black]
System information
Additional context
The basic version of my reconnection strategy, i have tested this with various methods [like reconnectingFlag] etc etc but still failing to avoid the loop described above. I've also used a flag for channel status and to only reconnect when status is not 'joined' but the TIMED_OUT forces a CLOSED after it and i'm getting strange race conditions.
The text was updated successfully, but these errors were encountered: