File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ void main() {
165
165
webSocket! .add (replyString);
166
166
167
167
// Send an insert event
168
- await Future .delayed (Duration (milliseconds: 10 ));
168
+ await Future .delayed (Duration (milliseconds: 100 ));
169
169
final insertString = jsonEncode ({
170
170
'topic' : topic,
171
171
'event' : 'postgres_changes' ,
Original file line number Diff line number Diff line change @@ -119,6 +119,9 @@ class SupabaseAuth with WidgetsBindingObserver {
119
119
case AppLifecycleState .detached:
120
120
case AppLifecycleState .inactive:
121
121
case AppLifecycleState .paused:
122
+ // Realtime channels are kept alive in the background for some amount
123
+ // of time after the app is paused. If we stop refreshing the token
124
+ // here, the channels will be closed.
122
125
if (Supabase .instance.client.realtime.getChannels ().isEmpty) {
123
126
Supabase .instance.client.auth.stopAutoRefresh ();
124
127
}
You can’t perform that action at this time.
0 commit comments