Skip to content

Commit d27dfda

Browse files
committed
test: fix mock test by increasing delay
1 parent 36c248e commit d27dfda

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/supabase/test/mock_test.dart

+1-1
Original file line numberDiff line numberDiff 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',

packages/supabase_flutter/lib/src/supabase_auth.dart

+3
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)