Skip to content

Fix editor crashes and noise from the October error reports - #129

Merged
Mistium merged 9 commits into
developfrom
fix-october-error-reports
Oct 6, 2026
Merged

Mistium merged 9 commits into
developfrom
fix-october-error-reports

Conversation

@Mistium

@Mistium Mistium commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Works through the 200 open error reports from 1 to 6 October. About 120 of them come from MistWarp code and are fixed here or in the fork PRs. The rest come from third-party extensions or browsers and are now filtered, or were already unactionable.

Depends on MistWarp/scratch-vm#25 for the extension-load crash: without it the editor still crashes, and the alert never shows. Related fork PRs: MistWarp/scratch-paint#5 and MistWarp/scratch-render#8.

Extension load failures no longer crash the editor (about 40 reports)

When a project's custom extension threw while starting in the sandbox ("must run unsandboxed", a cross-origin "Script error.", "reading 'runtime'"), the whole project load was rejected and the GUI showed the crash screen. This happened mostly in community embeds. With scratch-vm#25 the project loads without that extension, and the editor shows the existing "extension could not be loaded" alert. ?extension= URL failures get the same alert instead of an unhandled rejection.

Before (production), /editor?project_url=https://extensions.mistium.com/examples/roturVoice.sb3 after clicking Run extension:
Before: crash screen

After, the same project with this branch and scratch-vm#25:
After: project loads and shows the alert

IndexedDB unavailable (47 reports)

Private and lockdown modes in iOS Safari and Firefox. None of these crashed anything, but each leaked an unhandled rejection.

  • Packager cache: its cleanup ran on import, so every editor load opened IndexedDB. It now runs on first use and logs failures.
  • Project history: a new pnpm patch for @isomorphic-git/idb-keyval, plus an updated LightningFS patch, stop caching a failed open and stop re-awaiting a failed activation. A connection that closes or is closing is reopened once, and the background save logs failures instead of rejecting.
  • Local backpack: reopens a closing connection, and rejects aborted transactions instead of hanging (for example on QuotaExceededError).

Other fixes

  • "cannot find Backpack" (8): the folders addon only learned how to look inside React from the sprite list, which isn't rendered on narrow layouts or in stage-only projects. It also ignores a second patch from a double tap.
  • Sound editor reading 'soundId': it no longer reads a sound that was just deleted.
  • Spotlight "Variable id doesn't point to a real variable": the block index now rebuilds when variables change.
  • Stale chunk imports: the error is no longer thrown, and so no longer reported, while the page is already reloading. A tab can reload again after 60 seconds instead of only once per build.
  • Live collaboration: the host closes a data channel that was opened with JSON serialization, which no MistWarp client uses, before it can crash on binary data.
  • Rotur sign-in: closing the sign-in window when turning on chat signing now counts as declining, not an unhandled rejection.
  • Object.hasOwn polyfill: for iOS 15 Safari, where fake-indexeddb in the embed storage shim used it.

Error reporter

  • Script errors: "Script error." is now dropped even with Error: / Uncaught prefixes, along with errors relayed from sandboxed extensions and "must run unsandboxed" messages.
  • Browser noise: wallet scripts, Safari's EmptyRanges, pointer lock refusals, AbortError, rejections with no reason, and React removeChild errors on pages Google Translate has changed are dropped too.

Checks

lint, i18n:editor:check, i18n:community:check, check:community-css, deps:check, test:unit:ci (361 suites, 2425 tests), build:deploy and validate-deploy all pass locally. The screenshots come from a production build with scratch-vm#25 swapped in.

Preview

https://4a3dcf16.scratch-gui.pages.dev/editor is the Cloudflare preview. It builds against the forks' current develop, so the extension-load crash fix only shows up there after scratch-vm#25 merges and this preview is rebuilt.

Fixes production errors from browsers without usable IndexedDB (PS4 and
iOS lockdown Safari, Firefox strict and private modes) and from flaky
connections:

- "indexedDB is not supported", "IDB Error UnknownError: Internal error.",
  "Transaction error: UnknownError" and Firefox "IDBFactory.open: The
  operation is insecure" from the render-interface chunk: the packager's
  large-asset cache ran its cleanup at import, so every editor, player
  and fullscreen load opened the database and left the result unhandled.
  The cleanup now runs on first use of the cache and logs failures.
- "Can't find variable: indexedDB", "IDBFactory.open: The operation is
  insecure", "Unable to open database file on disk" and QuotaExceededError
  from project history (LightningFS): the open promise was already marked
  handled, but a failed activation stayed cached and LightningFS
  re-awaited it from its deactivation timer, and its debounced superblock
  flush had no handler either. Failed activations are cleared so the next
  operation retries, and the two timers log instead of rejecting.
- "The database connection is closing" from idb-keyval: a closing or
  browser-closed connection is forgotten and reopened once. idb-keyval
  also forgets a failed open, so storage that recovers works again, and
  closing a store that never opened resolves.
- The packager cache and the local backpack reopen a closing connection
  once, and the backpack rejects aborted transactions instead of hanging.
The block index was reused for as long as the same sprite was being edited, so after a variable, list or broadcast was deleted spotlight could still offer it. Picking that block set the field to an id the workspace no longer had and Blockly threw "Variable id doesn't point to a real variable". The index is now also keyed on the workspace's variables.
The folders addon took React's internal key from the first sprite in the
sprite list. A stage-only project or the narrow layout has no sprite list
yet, so opening the backpack threw "cannot find Backpack". Read the key
from the backpack element, keep listening until the backpack exists, and
skip patching a backpack that is already patched.
The sound editor's mapStateToProps can run with a stale index after the
last sound is deleted or the editing target changes, and getSoundBuffer
then read soundId from undefined.
lazyWithReload rethrew the chunk error after starting the reload, so the
error boundary reported every recovered stale deploy. Wait for the reload
instead, and allow another reload a minute later rather than once per
tab, so a tab that reloaded into the same build during a deploy can still
recover.
MistWarp clients dial with raw serialization, and older ones with PeerJS
binary. A channel opened with JSON serialization made PeerJS 1.3 call
JSON.parse on binary data and throw from the data channel handler.
Turn on signing called ensureScopes without handling a closed sign-in
popup, so closing it became an unhandled rejection.
Drop aborted operations, pointer lock refusals, wallet extension scripts,
Safari media control internals, rejections with no reason, and React
losing track of nodes on a machine translated page.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying scratch-gui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 12b6555
Status: ✅  Deploy successful!
Preview URL: https://4a3dcf16.scratch-gui.pages.dev
Branch Preview URL: https://fix-october-error-reports.scratch-gui.pages.dev

View logs

@Mistium
Mistium merged commit 154c75a into develop Oct 6, 2026
4 checks passed
@Mistium
Mistium deleted the fix-october-error-reports branch October 6, 2026 21:38
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