Repository navigation
Fix editor crashes and noise from the October error reports - #129
Merged
Merged
Conversation
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.
Deploying scratch-gui with
|
| 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 |
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.
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.sb3after clicking Run extension:After, the same project with this branch and scratch-vm#25:

IndexedDB unavailable (47 reports)
Private and lockdown modes in iOS Safari and Firefox. None of these crashed anything, but each leaked an unhandled rejection.
@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.QuotaExceededError).Other fixes
reading 'soundId': it no longer reads a sound that was just deleted.Object.hasOwnpolyfill: for iOS 15 Safari, wherefake-indexeddbin the embed storage shim used it.Error reporter
Error:/Uncaughtprefixes, along with errors relayed from sandboxed extensions and "must run unsandboxed" messages.EmptyRanges, pointer lock refusals,AbortError, rejections with no reason, and ReactremoveChilderrors 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:deployandvalidate-deployall 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.