Skip to content

Persist lifecycle IndexedDB work before navigation - #879

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

wieslawsoltes merged 1 commit into
mainfrom
fix/terminal-indexeddb-navigation-878

Conversation

@wieslawsoltes

Copy link
Copy Markdown
Collaborator

Problem

The unchanged Code OSS shutdown path schedules its workspace IndexedDB transaction from a lifecycle zero-delay task. WebScene could expose reload after the first lifecycle task while the descendant transaction and native storage completion were still pending, so AppScene replaced the realm before mcpInputs became durable.

Change

  • propagate a bounded terminal-persistence tag through lifecycle zero-delay tasks, native IndexedDB operations, and their Promise continuations;
  • keep reload/navigation private until that tagged work drains;
  • exclude intervals, delayed timers, animation frames, pre-existing work, and unrelated IndexedDB operations;
  • cap the task lineage at 1,024 entries so a self-refilling timer cannot starve navigation;
  • add a durable restart regression, an explicit CTest lane, and validation notes.

Closes #878.

Validation

  • WEBSCENE_NATIVE_ENGINE_TEST_FILTER=terminal-indexeddb-navigation: passed; durable handoff 0.0036 s.
  • WEBSCENE_NATIVE_ENGINE_TEST_FILTER=top-level-navigation-lifecycle: passed; 1,000 requests 0.0044 s.
  • git diff --check: passed.

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.

Keep lifecycle-descended IndexedDB commits ahead of terminal navigation

1 participant