Skip to content

fix(mobile): bootstrap presence snapshots reliably - #4417

Open
allynaadir0-spec wants to merge 1 commit into
block:mainfrom
allynaadir0-spec:fix/mobile-presence-bootstrap
Open

fix(mobile): bootstrap presence snapshots reliably#4417
allynaadir0-spec wants to merge 1 commit into
block:mainfrom
allynaadir0-spec:fix/mobile-presence-bootstrap

Conversation

@allynaadir0-spec

@allynaadir0-spec allynaadir0-spec commented Aug 2, 2026

Copy link
Copy Markdown

What changed

  • Subscribe to live presence before fetching the current relay snapshot.
  • Seed newly tracked users from the relay's synthesized presence response and resolve relay-signed snapshots through their p tag.
  • Prevent an older snapshot from overwriting a newer live event.
  • Retry failed snapshot queries and initial or late-closed presence subscriptions with capped backoff.
  • Clear stale presence after a live subscription closes, then resubscribe and resnapshot.
  • Treat a successful empty snapshot as offline, while showing Status unknown during bootstrap or a failed fetch instead of falsely claiming offline.
  • Add focused provider, DM-header, and profile-sheet regression coverage.

Why

Buzz Mobile only listened for future kind 20001 presence events. Opening a DM after an agent's latest event therefore left the cache empty, and the UI converted that missing state directly into Offline even when the relay's current presence snapshot said the agent was online.

User impact

DM headers, channel avatars, and profile sheets now converge on the relay's current presence without requiring the user to wait for another heartbeat or reopen the app. Temporary connectivity failures recover automatically, and unknown state is no longer misrepresented as offline.

Validation

  • 80 focused Flutter tests passed:
    • 17 presence-cache provider tests
    • 62 channel-detail tests
    • 1 profile-sheet test
  • Full mobile suite passed: 1,083 tests, with one intentional skip.
  • Full mobile flutter analyze passed with no issues.
  • Dart formatting and git diff --check passed.

@allynaadir0-spec
allynaadir0-spec marked this pull request as ready for review August 2, 2026 22:19
@allynaadir0-spec
allynaadir0-spec requested a review from a team as a code owner August 2, 2026 22:19
Signed-off-by: Naadir Ally <info.onelifesa@gmail.com>
@allynaadir0-spec
allynaadir0-spec force-pushed the fix/mobile-presence-bootstrap branch from a6e8cbb to 046221d Compare August 3, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants