Repository navigation
Keep loading a project when one of its extensions fails to load - #25
Merged
Merged
Conversation
A failed custom extension rejected the whole project load, which the GUI showed as a crash. Treat it like a denied extension: log it, emit EXTENSION_LOAD_ERROR and keep loading. Attach the handler as soon as the load starts so a failure while the next permission prompt is open is not an unhandled rejection, and let a failed load settle other waiters instead of rejecting them.
Mistium
added a commit
that referenced
this pull request
Oct 15, 2026
Keep loading a project when one of its extensions fails to load
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.
A custom extension that throws while it starts in the sandbox (most often "This extension must run unsandboxed", or a cross-origin "Script error.") rejected the whole
vm.loadProject. The GUI turned that rejection into the crash screen. In the error reports from 1 to 6 October this was the most common crash: about 40 reports, mostly from community project embeds.TurboWarp never reaches this state, because there a sandboxed extension that throws just hangs. MistWarp added a load deadline, so the failure surfaces and needs handling.
_loadExtensionsnow treats a failed project extension like a denied one, as MistWarp already does for denied extensions: it logs the failure, emitsEXTENSION_LOAD_ERRORwith{extensionID, url, error}, and keeps loading the project. The handler is attached as soon as the load starts, so an early failure no longer firesunhandledrejectionwhile the next permission prompt is open._failedLoadingExtensionScriptnow settles the waiters inallAsyncExtensionsLoaded()instead of rejecting them, so one bad?extension=URL no longer rejects the default project's wait for extensions.The GUI change that shows the "extension could not be loaded" alert for the new event is in scratch-gui. It needs this change deployed alongside it.
Tests: new cases in
test/integration/tw_security_manager.jsandtest/unit/tw_extension_manager.jsfail without the fix. The full tap unit and integration run passes (239 passed, 3 skipped).No visible surface in this repo; the visible result is in the scratch-gui PR.