Repository navigation
fix: release browser Runtime resources safely on disposal - #9
Merged
Merged
Conversation
Close runtime input immediately on disposal, retain borrowed state through the current synchronous operation, and release resources at the outermost exit. Restore active ownership after failed startup and preserve the primary error across cleanup. Co-Authored-By: Codex <noreply@openai.com>
ejgallego
marked this pull request as draft
October 28, 2026 18:37
Treat startup AbortError as quiet cancellation in generated page boot handlers. Exercise auto and Wasm cancellation, replacement ownership, and genuine failure reporting. Verify actual listener detachment and mount rebinding, and close decoded bitmaps before delivering their pixels. Co-Authored-By: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disposing a browser app should stop its browser effects and release its backend references. This adds idempotent Runtime disposal, integrates Wasm and remote startup, and restores the previous live owner when startup fails.
Disposal closes input and aborts cancellable work immediately. The current synchronous DOM opcode or delegated handler may finish, including a coalesced removal batch; no following opcode or ancestor handler starts. Handle tables and the transport remain valid until the outermost synchronous entry unwinds, then release exactly once. Terminal errors notify after cleanup; cleanup exceptions do not replace the original error. Async continuations check closure separately, and temporary image/frame handles close in
finally. Decoded bitmaps close before their pixels are delivered to Lean. The last DOM is retained.Server-generated boot handlers treat
AbortErroras quiet startup cancellation: they neither start a fallback app nor overwrite the current boot state or a replacement owner. Genuine startup failures still fall back inautomode and report failure inwasmmode.Validation:
autoandwasmmodes.Existing compiled Wasm artifacts were reused; the native page generator and callers were rebuilt for the cancellation change. Full site/Roster/container CI has not been run locally.
This is the shared Runtime layer of the planned stack. QED64 worker lifecycle and VIR SDK/byte effects will follow separately.