You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extension sandbox can hang 'Loading instances...' when a second IPC message hits a busy goja VM #33
In the mod browsers (Modrinth, CurseForge, Mod Manager), the install modal can get stuck on Loading instances... forever. #32 fixed the switching-browsers variant (stale EventsOn subscription). This issue covers the remaining hang.
Root cause
Manager.HandleIPCMessage (pkg/extensions/manager.go:375) invokes the extension's onMessage callback on the goja VM without any synchronization. goja is single-threaded and not thread-safe.
Sandbox callbacks block the VM for long Go operations:
installMod runs the entire mod download synchronously inside the VM call (manager.go:147-195).
requestConfirmation blocks the VM for up to 2 minutes waiting on the 'Allow extension action?' dialog (manager.go:283-304).
If a second IPC message arrives for the same extension while the first is in flight (e.g. opening another mod's modal while a confirm dialog or download is active), the second call enters the busy VM concurrently → goja hangs/corrupts → the callback never returns → no response event is emitted → the iframe waits forever.
Contributing issue
The iframe bridge sendMessage() in both modrinth and curseforge ui/script.js has no timeout and only resolves when a matching requestId arrives. Any lost/dropped response leaves the modal permanently stuck with no error or retry path.
Suggested fixes
Serialize sandbox callback execution with a per-sandbox mutex (second message waits for the first, then completes normally).
Add panic recovery in HandleIPCMessage that always emits an error response back to the iframe instead of silently dropping it.
Long operations (downloads, confirmation dialogs) should not hold the goja VM.
Add a timeout (e.g. 15s) to sendMessage in the extension UIs and surface a 'timed out, retry' state instead of an infinite spinner.
Activity