Comments (5)
aahhh!
When blocks are dragged from the flyout, a new CREATE event is generated for them - with a different workspaceId. But then, a DELETE event is fired for the old block in the flyout - which has the same block ID, but a different workspaceId.
Our implementation doesn't consider workspaceId because I assumed the blocks in the flyout would have unique IDs vs. the blocks in the workspace. Not sure why this didn't become a problem in the prototype. Probably a good way to solve this would be just track workspaceId on the block representation as well, e.g., blocks[workspaceId][blockId] = {...}
. Any thoughts, @thisandagain ?
from scratch-vm.
Oh, actually we never saw this in the prototype because flyout blocks were never created/destroyed after the first display of the flyout. This is only really a problem with category switches.
from scratch-vm.
Yikes. Tracking the workspace ID along with the block seems like a reasonable way to deal with it. This and #46 might be nice to talk about today.
from scratch-vm.
Other options include:
- Modify Blockly to generate a new unique ID for blocks when they're dragged from the flyout to the workspace.
- Tack on workspace ID to block ID in the VM representation (e.g., "workspaceId:blockId") and make sure to parse this correctly as it's going in and out.
from scratch-vm.
We've fixed the problem in scratch-blocks
by ensuring blocks always have a unique ID.
from scratch-vm.
Related Issues (20)
- Add JSON blocks HOT 1
- Issue with is-touching Block HOT 1
- npm start => Error: error:0308010C:digital envelope routines::unsupported HOT 2
- How to access the inside of vm in extension HOT 4
- How to display a part of a costume? HOT 2
- [ENA-266] JS TypeError when clicking a procedure in the toolbox
- Convert commonjs to esmodule.
- Onion skining HOT 2
- The hats for my Scratch extension don't work... HOT 3
- Download instead of Hent
- Copying and pasting (⌘C / ⌘V) blocks between sprites can cause local variables to share the same ID. HOT 1
- The link in the GitHub repo sidebar is broken HOT 2
- make a button upload image
- The project.json field in the.sb3 file is missing. After importing the file, the scratch3 environment cannot parse the file and an error is reported when the emitWorkspaceUpdate method is called internally.
- renaming a sprite doesn't update variable monitors for this sprite
- The sensing_of block doesn't work with the stage in an obscured shadow input HOT 3
- Problem https://github.com/scratchfoundation/scratch-vm/issues/3762 still not yet fixed since September, 2022 HOT 1
- startHats filter by a menu that acceptReporters HOT 1
- Too many arguments in serializeBlock call
- Broadcasts are not completed before rerun thus DeleteClone does not finish in time. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scratch-vm.