Skip to content

Commit a8e8028

Browse files
committed
fix(mobile): initialize presence before synchronous readiness
Signed-off-by: Logan Johnson <[email protected]>
1 parent b23bc30 commit a8e8028

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎mobile/lib/features/profile/presence_cache_provider.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class PresenceCacheNotifier extends Notifier<Map<String, String>> {
5959
_schedule(generation);
6060
}
6161
});
62-
unawaited(_subscribe(generation));
62+
// A transport may report ready synchronously; initialize state first.
63+
Future.microtask(() => _subscribe(generation));
6364
}
6465
return {};
6566
}

‎mobile/test/features/channels/channel_detail_page_test.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14160,6 +14160,10 @@ class _IdentityUpdateRelaySession extends RelaySessionNotifier {
1416014160
}
1416114161
};
1416214162
}
14163+
if (!filter.kinds.contains(39002)) {
14164+
onStatusChanged(RelaySubscriptionStatus.ready);
14165+
return () {};
14166+
}
1416314167
_membershipListener = onEvent;
1416414168
_membershipStatusListener = onStatusChanged;
1416514169
onStatusChanged(RelaySubscriptionStatus.ready);

‎mobile/test/features/profile/presence_snapshot_test.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class _Relay extends RelaySessionNotifier {
288288
emit = onEvent;
289289
status = onStatusChanged;
290290
close = onClosed!;
291+
onStatusChanged(RelaySubscriptionStatus.ready);
291292
if (ready != null) await ready!.future;
292293
return () => unsubscribes++;
293294
}

0 commit comments

Comments
 (0)