Skip to content

Clean up VIR apps after startup failures and shutdown - #12

Merged
FawadHa1der merged 2 commits into
FawadHa1der:mainfrom
ejgallego:fix/vir-lifecycle
Nov 4, 2026
Merged

FawadHa1der merged 2 commits into
FawadHa1der:mainfrom
ejgallego:fix/vir-lifecycle

Conversation

@ejgallego

Copy link
Copy Markdown
Contributor

A VIR program can stay alive after its app fails to start or its LeanUI runtime is disposed. This connects the VIR adapter to LeanUI's existing cleanup support.

Failed starts release the new program and restore the previous active runtime. Calling dispose() stops browser work, releases the VIR program once, and blocks later callbacks. Fatal interpreter or screen-update errors stop the app; recoverable errors still allow input. The Bench and Life pages treat deliberate startup cancellation quietly.

Tests use a small Lean app with storage, timers, focus and fetch requests. All 11 test groups pass in Chromium and Firefox, covering repeated shutdown, both startup calls, late callbacks, and cleanup errors. The tests simulate a fatal interpreter error and also exercise a real recoverable Lean error.

Bench and Life also match the vanilla results in both browsers: all nine table operations agree, and Life reaches the expected board after 100 steps. These are correctness checks, with no performance claim.

The existing packet format and runtime pin are unchanged. Full site/Roster/QED64 CI has not been run locally.

ejgallego and others added 2 commits October 30, 2026 01:20
Use the shared Runtime startup and cleanup support, retire terminal interpreter or DOM errors, and keep recoverable errors usable. Treat cancelled demo startup quietly. Add a small Lean test app and browser coverage for real callbacks, disposal, startup rollback and error handling.

Co-Authored-By: Codex <noreply@openai.com>
Keep the response body open until disposal and verify that the browser aborts the request. Clarify which startup phase supports disposal.

Co-Authored-By: Codex <noreply@openai.com>
@FawadHa1der
FawadHa1der merged commit 21abbb8 into FawadHa1der:main Nov 4, 2026
3 checks passed
@ejgallego
ejgallego deleted the fix/vir-lifecycle branch November 4, 2026 14:16
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.

2 participants