Skip to content

Promote in-flight IndexedDB work at terminal handoff - #883

Merged
wieslawsoltes merged 1 commit into
mainfrom
fix/indexeddb-terminal-promotion-882
Sep 20, 2026
Merged

wieslawsoltes merged 1 commit into
mainfrom
fix/indexeddb-terminal-promotion-882

Conversation

@wieslawsoltes

Copy link
Copy Markdown
Collaborator

Problem and result

Code OSS can begin an idle IndexedDB storage transaction before reload. WebScene retained lifecycle-descended persistence work, but realm teardown could still retire this already queued transaction, intermittently losing the workspace mcpInputs record.

This change routes IndexedDB compatibility tasks through a private tagged scheduler and promotes already queued IndexedDB tasks and native operations into the existing bounded terminal handoff. The public timer contract is unchanged, and unrelated timers remain outside the boundary.

The regression queues a transaction before reload, a second write from beforeunload, and an abort from pagehide; it proves both writes and their continuation complete before handoff and remain durable after engine restart.

Closes #882.

Validation

cmake --build /private/tmp/webscene-882-build --target webscene_native_engine_tests -j 3
WEBSCENE_NATIVE_ENGINE_TEST_FILTER=terminal-indexeddb-navigation /private/tmp/webscene-882-build/webscene_native_engine_tests

Passed on macOS arm64 Release in 0.0037 seconds. The exact Code OSS package gate follows against the merged commit.

@wieslawsoltes
wieslawsoltes merged commit 2520661 into main Sep 20, 2026
0 of 7 checks passed
@wieslawsoltes
wieslawsoltes deleted the fix/indexeddb-terminal-promotion-882 branch September 20, 2026 23:26
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.

Preserve nested IndexedDB transaction tasks through terminal pagehide

1 participant