Printable idea sheet
webview_claim_race
reqlan rq/extension/host/startup-performance.rq:69
Katz 0.091
Setting `webview.html` or calling `postMessage` before the workbench has claimed the overlay ( or after it has disposed it ) can fail with `Webview is in an invalid state` / `Webview is disposed`.
This is intermittent and more common on Windows during extension init, when the activity-bar view is restored in the same tick as another webview ( first-run onboarding ).
Contract:
- Activity-bar host posts only after the webview's `ready` signal; `post` is a no-op until then and swallows disposed / invalid-state errors.
- `resolveWebviewView` may run more than once: dispose prior view listeners, clear `webviewReady`, rebind, reassign HTML.
- First-run onboarding waits for the activity-bar paint gate or 400 ms, whichever first, so it does not register a second webview service worker during sidebar claim. Palette `reqlan.showOnboarding` stays immediate.
Index and language-client startup still use the existing paint / timeout fallbacks — a dead sidebar must not strand indexing.
first_paint_contract onboarding_check
activity-bar-webview-provider.ts
main.ts
safe-webview-post.ts
- status
- done
- tests
- "../../../packages/extension/test/safe-webview-post.test.ts"
Interactive page: webview_claim_race