-
-
Notifications
You must be signed in to change notification settings - Fork 200
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 Channel seems to go to sleep after a while (~15 minutes) in Flutter App #388
Comments
This happens due to Supabase closing a connection if it's unused within X minutes. @Vinzent03 is working on a PR that will allow us to capture the Exception that occurs and reconnect like that. |
Thanks for the excellent support....
…On 3/7/2023 12:28 PM, Daniel Mossaband wrote:
This happens due to Supabase closing a connection if it's unused
within X minutes.
@Vinzent03 <https://github.com/Vinzent03> is working on a PR that will
allow us to capture the Exception that occurs and reconnect like that.
—
Reply to this email directly, view it on GitHub
<#388 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6D63O3II5DNEIQ7JGCMTDW2546NANCNFSM6AAAAAAVSYXXPA>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
---------------------------------
Jim ***@***.***>
UpITs: Unparalleled IT Solutions
Phone: 918-527-1106
Web:http://www.UpITs.com
---------------------------------
|
Is this issue with |
I'm not sure if this issue would be due to Supabase cutting off the connection after being idle. But now that we can catch the error if/when it happens, we can decide how to handle it on a case by case basis. Like for me, I want it so that if the app goes in the background the connection stops, and it starts again once the app is foregrounded. |
Will check it out this weekend
…On 3/16/2023 12:39 PM, Vinzent wrote:
Is this issue with |realtime_client: ^1.0.3| resolved? Run (|flutter
pub upgrade realtime_client|)
—
Reply to this email directly, view it on GitHub
<#388 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6D63OWETMFVNQAXAQVQE3W4NF5NANCNFSM6AAAAAAVSYXXPA>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
---------------------------------
Jim ***@***.***>
UpITs: Unparalleled IT Solutions
Phone: 918-527-1106
Web:http://www.UpITs.com
---------------------------------
|
I am not able to reproduct this quite yet, but @upits whenever you have the chance to try it out, would you be able to add callback to your .subscribe((event, [error]) {
print(event);
print(error);
}); @DanMossa |
@dshukertjr I actually can't get it to reproduce with the new fixes that @Vinzent03 added! |
Will do it this weekend. Thanks for all the help.
Jim Sills ***@***.***>
UpITs: Unparalleled IT Solutions
Phone: 918-527-1106
…On Mar 17, 2023, 8:26 PM, at 8:26 PM, Tyler ***@***.***> wrote:
I am not able to reproduct this quite yet, but @upits would you be able
to add callback to your `.subscribe` method like this to see if the
connection is erroring or closing?
```dart
.subscribe((event, [error]) {
print(event);
print(error);
});
```
@DanMossa
Realtime SDK not reconnecting after going into background mode and
coming back seems like a separate issue, but might be a good issue to
tackle! Would you want to open an issue for it?
--
Reply to this email directly or view it on GitHub:
#388 (comment)
You are receiving this because you were mentioned.
Message ID:
***@***.***>
|
Here was out test setup
Android: Samsung Phone; Google Phone
Android Studio: Running an emulator
Windows Version: Windows 11
Web Version: Running in Chrome on Windows 11
All 3 Android versions (2 phone, and emulator) lost real time updates
after 30 minutes of no Supabase activity
All other versions (Windows, Web) did not loose real time updates after
30 minutes of no Supabase activity
I added the code below to the Emulator (Android Studio) and no Event or
Error printed
…On 3/17/2023 8:25 PM, Tyler wrote:
I am not able to reproduct this quite yet, but @upits
<https://github.com/upits> would you be able to add callback to your
|.subscribe| method like this to see if the connection is erroring or
closing?
.subscribe((event, [error]) {
print(event);
print(error);
});
@DanMossa <https://github.com/DanMossa>
Realtime SDK not reconnecting after going into background mode and
coming back seems like a separate issue, but might be a good issue to
tackle! Would you want to open an issue for it?
—
Reply to this email directly, view it on GitHub
<#388 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6D63KDD4YUF27YPUCU2JDW4UFKJANCNFSM6AAAAAAVSYXXPA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
---------------------------------
Jim ***@***.***>
UpITs: Unparalleled IT Solutions
Phone: 918-527-1106
Web:http://www.UpITs.com
---------------------------------
|
@upits |
@upits |
same issue happened in iOS return db
.stream(primaryKey: ['room_id'])
.eq('uid', uid)
.order('updated_at')
.limit(1); I used the stream method, and if I stayed in the pause state for about 30 minutes, I felt like socket was automatically disconnected |
Maybe a debounce timer should be added to check if the channels are still active? |
@dshukertjr I caught an error in the supabase realtime with firebase crashlytics Do you happen to know the cause?
|
@dshukertjr |
@jaejune |
|
I recently experienced the same problem, even though the other app, which has been running for almost two years using Supabase and the supabase_flutter package with Flutter StreamBuilder and Supabase realtime, still experiences the same issue now. I have not made any changes to the app recently. The problem occurs on iOS and web platforms when using Flutter StreamBuilder with the supabase_flutter package and realtime. The error occurred in StreamBuilder, and I received the error when I checked if (snapshot.hasError) in StreamBuilder, but snapshots.error was empty. Is there anyone in the Supabase community or on the Supabase tech team who can help resolve this problem? It is a serious problem that is disrupting my customers and me. I would appreciate your help. |
@Vinzent03 Any updates on this? Still happens on v.1.10.14 it is a huge problem since the data is not reflected on the app past ~15 mins or after computer sleeps. |
Anyone experiencing this issue, would you please provide as detailed as possible steps to reproduce this error? I have tested the realtime connection on iOS, Android, and web, and I am able to receive real-time events for multiple hours without any issues. If anyone could create a minimal Flutter app that can reliably reproduce this issue and share its GitHub repo, that would help us a lot at finding the cause and fixing this issue. |
I created a minimal Flutter (desktop/MacOS) app to reproduce my issue: #579. Since it is also a realtime issue this could be related. Maybe you can have a look at it. |
@JasonChiu-dev For other folks experiencing real-time stream closing after around 15 min or so, I am actually still unable to reproduce the issue. If you can reliably reproduce the issue, I would really appreciate it if you could let me know so that we could work together to find the root cause of it. |
Hi @dshukertjr 👋🏾 Step 1 => Open Both the web app link and Zapp Project Link ![]() |
Hi @dshukertjr , I'm still facing this issue as well. I'm currently doing a POC in a seperate branch where Im migrating my app from firebase to supabase. This is one bug that is seriously bothering me which was actually very seamless in firebase. Currently using the latest supabase flutter version [1.10.25]. Is there any update on the fix for this issue ? For more context, this issue is happening in both IOS simulator and Android physical device. |
any updates on this? |
With #1019 being merged now, these issues should be solved now. You can try them by upgrading |
Flutter app subscribed to Realtime channel stops receiving events after a while (~15 minutes). The app has to be closed and reopened then events will be received again (for a while ~15 minutes).
Subscription code:
The text was updated successfully, but these errors were encountered: