Skip to content

OPE-119: Stale Live session after background network changes #442

Closed

Description

@ivanfenenko

Symptom

After backgrounding Android Session Chat (Wi-Fi reconnects / long away), resume can show Live with no new messages. Home may later flip to Connecting. Re-entering the session can still look Live on a stale timeline until pull-to-refresh.

Root cause

  1. Background stop() clears wasConnected, so cold foreground start() reaches Connected/Live without synthetic stream.reconnected.
  2. Message refresh then depends on server.connected.
  3. If that event is missed and a turn was mid-stream, hasStreamingText blocks the 10s poll watchdog — timeline stays stale while UI stays Live.

Fix

On Android + iOS MessageSync:

  • Returning to Connected after a transport drop (or epoch drift) adopts the current epoch and runs reconnect fullReload.
  • Transport drop clears latched streaming text so poll is not blocked forever.

Docs: docs/features/foreground-event-stream/decisions.md

Test plan

  • Android MessageSyncTest background-resume streaming + non-streaming cases
  • iOS MessageSyncTests matching cases
  • Device: background mid-turn, change networks, resume — messages refresh without PTR

Imported from Linear OPE-119. Linear status: Done. Priority: High. Created 2026-08-08. Completed 2026-08-08.
Related: OPE-165.

Activity

  1. self-assigned this
    on Oct 11, 2026
  2. added
    bug
    ios
    android
    shared
    priority: high
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

androidbugiospriority: highshared

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions