Fix flickering issues due to reconnecting loop

This commit is contained in:
2026-03-02 22:09:29 +08:00
parent 5713581992
commit 7115e2df05
8 changed files with 171 additions and 45 deletions
+5 -1
View File
@@ -94,8 +94,12 @@ class RealtimeController extends ChangeNotifier {
/// Convenience callback suitable for [StreamRecoveryWrapper.onStatusChanged].
///
/// Routes [StreamConnectionStatus] to the appropriate mark method.
/// Both `connected` and `polling` are treated as "recovered" because
/// polling is a functional fallback that still delivers data — the user
/// doesn't need to see a reconnection indicator while data flows via REST.
void handleChannelStatus(String channel, StreamConnectionStatus status) {
if (status == StreamConnectionStatus.connected) {
if (status == StreamConnectionStatus.connected ||
status == StreamConnectionStatus.polling) {
markChannelRecovered(channel);
} else {
markChannelRecovering(channel);