Skip to content

Keep loading a project when one of its extensions fails to load - #25

Merged
Mistium merged 1 commit into
developfrom
extension-load-failures
Oct 6, 2026
Merged

Mistium merged 1 commit into
developfrom
extension-load-failures

Conversation

@Mistium

@Mistium Mistium commented Oct 6, 2026

Copy link
Copy Markdown
Member

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.

  • _loadExtensions now treats a failed project extension like a denied one, as MistWarp already does for denied extensions: it logs the failure, emits EXTENSION_LOAD_ERROR with {extensionID, url, error}, and keeps loading the project. The handler is attached as soon as the load starts, so an early failure no longer fires unhandledrejection while the next permission prompt is open.
  • _failedLoadingExtensionScript now settles the waiters in allAsyncExtensionsLoaded() 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.js and test/unit/tw_extension_manager.js fail 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.

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
Mistium merged commit 6035d90 into develop Oct 6, 2026
2 checks passed
Mistium added a commit that referenced this pull request Oct 15, 2026
Keep loading a project when one of its extensions fails to load
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.

1 participant