Skip to content

fix: resume SSE stream on pageshow regardless of persisted flag - #133

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
132-fix-stuck-reconnecting-banner-after-pageshow-with-persisted=false
Aug 7, 2026
Merged

jeonghun-jj-lee merged 1 commit into
local/amicodefrom
132-fix-stuck-reconnecting-banner-after-pageshow-with-persisted=false

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Summary

Remove the event.persisted guard from resumeStreamAfterPageShow so that start() is called on every pageshow event. VS Code webview iframes never fire pageshow with persisted = true (bfcache is a browser-only concept), so the SSE stream was permanently stopped after a pagehide.

start() is idempotent (if (started) return run at line 270), so unconditional calls are safe — no risk of duplicate SSE connections.

Changes

  • packages/app/src/context/server-sdk.tsx — removed the if (!event.persisted) return guard; retained the _event parameter for signature contract.
  • packages/app/src/context/server-sdk.test.ts — updated the test to expect start() on both persisted: true and persisted: false; added an idempotency test.

Acceptance Criteria

  • After a simulated pagehide + pageshow (with persisted = false), the SSE stream restarts and streamStatus transitions back to "connected"
  • The existing resumeStreamAfterPageShow unit test passes with the updated expectation (both persisted: true and persisted: false call start())
  • The ConnectionBanner shows the green "Server reconnected" flash and then hides within 3 seconds after recovery (component unchanged — already handles this)
  • No behavior change when pageshow fires without a preceding pagehide (start() is idempotent — no double streams)

Closes #132

Remove the event.persisted guard from resumeStreamAfterPageShow so that
start() is called on every pageshow event. VS Code webview iframes never
fire pageshow with persisted=true (bfcache is a browser-only concept),
leaving the SSE stream permanently stopped after a pagehide.

start() is idempotent (if (started) return run), so unconditional calls
are safe — no risk of duplicate SSE connections.

Closes #132
@jeonghun-jj-lee jeonghun-jj-lee linked an issue Aug 7, 2026 that may be closed by this pull request
4 tasks
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 7, 2026 20:05
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 489b336 into local/amicode Aug 7, 2026
1 of 4 checks passed
jeonghun-jj-lee added a commit that referenced this pull request Aug 7, 2026
fix: re-apply PR #133 — resume SSE stream on pageshow regardless of persisted flag
@jeonghun-jj-lee
jeonghun-jj-lee deleted the 132-fix-stuck-reconnecting-banner-after-pageshow-with-persisted=false branch August 7, 2026 20:46
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.

Fix stuck reconnecting banner after pageshow with persisted=false

1 participant