Repository navigation
Pass the load cancellation check through the project metadata wrapper - #201
Merged
Merged
Conversation
mw-project-metadata wraps vm.deserializeProject to read the loaded meta, but forwarded only the project and zip. The VM's third argument, the check that a load is still current, was dropped, so a project load superseded by a newer one could still install its targets. The wrapper now forwards every argument, with a test.
Deploying scratch-gui with
|
| Latest commit: |
ba676af
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f90642e7.scratch-gui.pages.dev |
| Branch Preview URL: | https://fix-deserialize-active.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.
lib/mw-project-metadata.jswrapsvm.deserializeProjectto read the meta a project arrived with, but forwarded only(projectJSON, zip). The VM takes a third argument,active, which checks that the load is still the current one. Dropping it meant a project load superseded by a newer one, such as opening two projects quickly, could still go on to install its targets. The wrapper now forwards every argument.An independent review of the VM's new extension points found this (MistWarp/scratch-vm#40). Once the GUI moves to
vm.registerProjectMetadatafrom that PR, this wrapper goes away entirely.Checks: a new unit test fails without the fix and passes with it, and
jest --ci test/unitpasses apart from the 5 stale tests fixed in #195. There is no visible change.