Skip to content

Retain terminal storage flush after lifecycle disposal - #885

Merged
wieslawsoltes merged 1 commit into
mainfrom
fix/884-terminal-cancelled-flush
Sep 21, 2026
Merged

wieslawsoltes merged 1 commit into
mainfrom
fix/884-terminal-cancelled-flush

Conversation

@wieslawsoltes

Copy link
Copy Markdown
Collaborator

Closes #884. Parent acceptance epic: #269.

VS Code emits its final storage state during beforeunload, schedules a zero-delay flush, then synchronously disposes its Delayer and clears that handle. WebScene therefore published pagehide before the callback could start its IndexedDB transaction. This retains only zero-delay one-shot callbacks already accepted into the bounded terminal handoff when same-turn lifecycle disposal clears their public handles. Ordinary timers, delayed work, intervals, animation frames, and the existing 1,024-task ceiling keep their current behavior.

The focused native fixture reproduces the exact VS Code sequence, fails before the runtime change, and now verifies callback/IndexedDB/continuation/pagehide order, restart durability, ordinary clearTimeout, excluded future timers and intervals, and the bounded refill ceiling.

Validation:

  • WEBSCENE_NATIVE_ENGINE_TEST_FILTER=terminal-indexeddb-navigation /private/tmp/webscene-882-build/webscene_native_engine_tests
  • macOS arm64 Release: pass, durable handoff 0.0036 seconds
  • git diff --check

@wieslawsoltes
wieslawsoltes merged commit c10b782 into main Sep 21, 2026
1 of 7 checks passed
@wieslawsoltes
wieslawsoltes deleted the fix/884-terminal-cancelled-flush branch September 21, 2026 00:00
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.

Retain same-turn canceled terminal storage flush through reload handoff

1 participant