Skip to content

Defer terminal IndexedDB close behind storage flush - #886

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

wieslawsoltes merged 1 commit into
mainfrom
fix/884-terminal-indexeddb-close

Conversation

@wieslawsoltes

Copy link
Copy Markdown
Collaborator

Completes the remaining exact-package race in #884; parent acceptance epic #269.

After PR #885 retained VS Code's same-turn canceled terminal flush callback, repeated package runs showed that its shutdown microtask could still call IDBDatabase.close() before the callback started its transaction. This queues only a close requested from the active terminal lifecycle while accepted persistence work remains. The retained flush runs first, its transaction and descendants commit, then the connection closes before pagehide and host handoff. Normal close calls remain synchronous.

The focused fixture now reproduces beforeunload → canceled retained flush + shutdown-microtask close and verifies close request → flush → commit → continuation → pagehide order, restart durability, ordinary timer cancellation, excluded delayed work, and the existing 1,024-task bound.

Validation:

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

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

1 participant