File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ void main() {
165165 webSocket! .add (replyString);
166166
167167 // Send an insert event
168- await Future .delayed (Duration (milliseconds: 10 ));
168+ await Future .delayed (Duration (milliseconds: 100 ));
169169 final insertString = jsonEncode ({
170170 'topic' : topic,
171171 'event' : 'postgres_changes' ,
Original file line number Diff line number Diff line change @@ -119,6 +119,9 @@ class SupabaseAuth with WidgetsBindingObserver {
119119 case AppLifecycleState .detached:
120120 case AppLifecycleState .inactive:
121121 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.
122125 if (Supabase .instance.client.realtime.getChannels ().isEmpty) {
123126 Supabase .instance.client.auth.stopAutoRefresh ();
124127 }
You can’t perform that action at this time.
0 commit comments