Repository navigation
Keep the private CacheStorage bridge callable after worker bootstrap #385
Description
Activity
- addedvscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integrationPlanned for the AppScene/WebScene VS Code OSS integration
on Sep 18, 2026 Owned from exact main
b5b51017ab1888ecdadbb638590afa645ee5f62aonfeature/webview-resource-next-266.Reproduction: Chrome 153 passes the pinned unchanged Markdown v6 fixture in 1.894 s. Native
service-worker-markdown-resourcesfails at the first cache-backed streamed resource withReferenceError: __webSceneServiceWorkerGlobalControl is not defined. The bootstrap correctly removes this private host hook fromglobalThis, but the public Cache/CacheStorage methods later look it up by that deleted global name instead of using the captured closure.#385 owns only closure use plus a privacy regression assertion and exact unchanged-worker/cache gates. It preserves origin/registration partitioning, CSP, admission, status/range/validator semantics, quotas, stream/body bounds, and all filesystem/network authority.
Collision audit: open PR #384 owns CSS supports-rule files; #382 owns File System durable grants; #267/#268 own nested-document and interaction behavior; #76 owns compatibility docs. This slice owns
webscene_v8_runtime_service_workers.inc, its CacheStorage/unchanged-Markdown focused tests, and the existing cache replacement contract/profile only if needed. It excludes those active lanes, AppScene, consolidation, and vscode-demo.Completed in #387, merged as
d4dc4fc10d98edd2a8a45a2901692c614d084652.The Cache and CacheStorage methods now retain the private native control closure after bootstrap removes the temporary global hook. Product worker code cannot observe the hook, while unchanged Code OSS v6 can cache its first streamed Markdown resource and continue through replacement/validator reuse. Origin and registration partitioning, CSP, admission, quotas, range/validator behavior, stream/body bounds, and filesystem/network authority are unchanged.
Final evidence:
- unchanged Code v6 native Markdown resource gate passed; cache replacement completed 100 cycles at 0.349 ms p95 with one body stream and flat V8 heap, and CSS-image delivery completed 100 cycles at 0.199 ms p95;
- CacheStorage replacement contract passed Chrome 153 5/5 and native 5/5 while asserting the private bridge is absent from
globalThis; - native resource-plane gate passed 100 cycles at 0.133 ms p95 with flat heap; range/cache passed 100 warm cycles at 0.185 ms p95 and a 32 MiB batch in 9.92 ms;
- exact-head Linux, macOS, portable V8, NativeAOT Avalonia 11/12, and native Linux document contracts all passed;
- Keep the private CacheStorage bridge callable after worker bootstrap #385 is closed and remains natively attached to Stream and cache admitted Code OSS webview resources #266; NuGet and redundant postmerge runs were canceled.
No nested-document, interaction, File System, CSS, AppScene, consolidation, or vscode-demo paths changed.
Parent: #266
Proven failure
Exact WebScene
b5b51017ab1888ecdadbb638590afa645ee5f62adeletes the private native Service Worker control hook after bootstrap, but the product-neutralCacheandCacheStoragemethods still resolve that deleted global at call time. The unchanged Code OSS v6 worker reachescache.match()on its first streamed Markdown resource and fails natively with:ReferenceError: __webSceneServiceWorkerGlobalControl is not definedChrome 153 passes the unchanged pinned Markdown resource fixture. WebScene's focused
service-worker-markdown-resourcesgate reproduces the native failure before resource delivery.Focused scope
Collision boundary
Owned paths are the Service Worker cache bootstrap include, its focused native regression gate, and the existing dedicated CacheStorage contract/profile only if the browser-visible privacy assertion is missing. This child excludes nested-document #267, interaction #268, File System work #382, CSS #381/PR #384, consolidation #76, AppScene, and vscode-demo.
Acceptance
globalThiswhile every exposed Cache/CacheStorage method remains callable.Refs #264
Refs #227