Skip to content

Run query-bearing iframe Worker bootstrap after document fetch #421

Closed

Description

@wieslawsoltes

Parent: #81
Release: #227

Proven gap

The unchanged Code OSS browser extension host creates a same-origin iframe whose URL is webWorkerExtensionHostIframe.html?&vscodeWebWorkerExtHostId=.... On the installed-SDK Release built from AppScene d4a73888 and WebScene dd39f118, the document request succeeds with HTTP 200 and 6,786 bytes, but the expected nested bootstrap/Worker/transferred-MessagePort sequence does not complete. The independent remote Node extension host is healthy.

Current product-neutral coverage proves query-bearing iframe navigation and iframe-created module Worker/MessagePort transfer independently. It does not combine asynchronous document fetch, the exact query-bearing URL shape, source Window identity, nested bootstrap messaging, module Worker creation, and transferred-port delivery.

Scope

  • Reduce the missing generic boundary on current WebScene main.
  • Add a Chromium/browser oracle for the exact query-bearing navigated iframe sequence.
  • Add a focused native contract for asynchronous document fetch through nested Worker creation and transferred MessagePort identity/order.
  • Fix only the proven reusable WebScene defect.
  • Add bounded timing, queue, memory/GC, navigation/detach, Worker termination, and engine-teardown gates for the changed path.
  • Rerun unchanged packaged Code OSS acceptance from the merged WebScene head.

Boundaries

Acceptance

  • Chromium and native complete iframe bootstrap -> Worker -> transferred port -> reply with exact source/port identity and ordering.
  • Query parameters are preserved in the nested realm and used by the bootstrap.
  • Failures remain visible and origin/admission checks remain fail-closed.
  • Repeated navigation/detach/termination cycles return queue/binding/heap metrics to bounded steady state with no late callback.
  • Unchanged packaged Code OSS records extensionPortTransferred and completes browser extension-host Ready/Initialized without application changes.

Activity

  1. wieslawsoltes commented on Sep 18, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Merged in #424 at e523daa11ae3ac4d06a9cbba64561ec06bd271f3 from exact tested head f38ba61e592b1c1c57ad538418ee40eb5ba4917a.

    The native reduction reproduced the unchanged VS Code OSS query-bearing iframe handshake. Before the fix, the fetched nested document posted its bootstrap, but event.source !== iframe.contentWindow; after correcting source identity, the reply sent through iframe.contentWindow still targeted the owner context rather than the current child realm. WebScene now materializes the stable same-origin iframe WindowProxy before child script runs, captures that proxy as MessageEvent.source, and routes proxy postMessage() to the iframe's current inner context.

    Evidence:

    • focused native CTest after rebasing onto the FileReader scheduler merge: pass in 3.13 s;
    • native WebPlatformSubset: 1/1 document, 7/7 assertions, 94 ms;
    • Chrome 153.0.8010.50 oracle: 1/1 document, 7/7 assertions, 102 ms;
    • 20 complete fetched iframe → module Worker → transferred MessagePort → reply teardown cycles: p95 156.10 ms, max 156.63 ms;
    • low-memory collection returned V8 used heap to baseline; native DOM/wrapper and RSS budgets passed;
    • adjacent 100-cycle iframe navigation lifecycle gate passed;
    • hosted portable V8 contract passed before merge.

    Branch NuGet, broad CI/native-document tails and post-merge CI/NuGet tails were canceled after the focused change-related gates passed. #421 is closed by the merged PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions