fix(app): handle iOS backgrounding - resync session and reconnect SSE on resume#10723
Closed
athal7 wants to merge 1 commit intoanomalyco:devfrom
Closed
fix(app): handle iOS backgrounding - resync session and reconnect SSE on resume#10723athal7 wants to merge 1 commit intoanomalyco:devfrom
athal7 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
… on resume - Add visibilitychange listener in session.tsx to resync when tab becomes visible - Refactor global-sdk.tsx SSE consumption with auto-reconnect on clean disconnect - Use exponential backoff (1s-30s) and pause reconnects while hidden - Add visibility tracking utility to detect recent backgrounding - Gate error toasts in prompt-input.tsx when failure likely due to backgrounding - Check if message landed before removing optimistic UI on resume Fixes anomalyco#10721
79a5c8c to
d5a3fa3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes session history rollback and error toasts that appear when resuming OpenCode web UI on iOS after backgrounding.
Changes
1. Visibility-triggered session resync (
pages/session.tsx)visibilitychangelistener that resyncs the current session when the tab becomes visible after being hidden for 1+ seconds2. SSE auto-reconnect with backoff (
context/global-sdk.tsx)3. Visibility tracking utility (
utils/visibility.ts)wasRecentlyBackgrounded(thresholdMs)detects if the page was just resumed from background4. Background-aware error handling (
components/prompt-input.tsx)Fixes #10721