Skip to content

Pass the load cancellation check through the project metadata wrapper - #201

Merged
Mistium merged 1 commit into
developfrom
fix-deserialize-active
Nov 1, 2026
Merged

Mistium merged 1 commit into
developfrom
fix-deserialize-active

Conversation

@Mistium

@Mistium Mistium commented Nov 1, 2026

Copy link
Copy Markdown
Member

lib/mw-project-metadata.js wraps vm.deserializeProject to 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.registerProjectMetadata from that PR, this wrapper goes away entirely.

Checks: a new unit test fails without the fix and passes with it, and jest --ci test/unit passes apart from the 5 stale tests fixed in #195. There is no visible change.

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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Deploying scratch-gui with  Cloudflare Pages  Cloudflare Pages

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

View logs

@Mistium
Mistium merged commit 0634633 into develop Nov 1, 2026
1 check passed
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