refactored and condensed technical documentation and comments across the codebase to improve readability
This commit is contained in:
@@ -196,12 +196,9 @@ class ChatBloc
|
||||
|
||||
void _startLongPoll(String token) {
|
||||
if (!_appResumed) return;
|
||||
// A load chain may finish AFTER the user already switched chats — e.g. a
|
||||
// notification tap resumes the app (lifecycle refresh starts loading the
|
||||
// still-open chat A) and then navigates to chat B. Without this guard the
|
||||
// stale chain's completion would hijack the long-poll back to A and its
|
||||
// responses would merge A's messages into B's state (chat B showing chat
|
||||
// A's content) while B never receives live updates.
|
||||
// A load chain may finish after the user switched chats (A→B); without this
|
||||
// guard the stale chain hijacks the long-poll back to A and merges A's
|
||||
// messages into B's state while B never receives live updates.
|
||||
if ((innerState?.currentToken ?? '') != token) return;
|
||||
if (_pollingToken == token) return;
|
||||
_stopLongPoll();
|
||||
|
||||
Reference in New Issue
Block a user