Disposing of a procedure definition disposes caller *and* next blocks
Check for duplicates
- [X] I have searched for similar issues before opening a new one.
Component
block-sharable-procedures
Description
When you dispose of a procedure definition, it disposes of the callers (this is correct). However, it also disposes of the callers next blocks, which is not correct.
Reproduction steps
-
Create the following arrangement in the sharable procedures demo
-
Delete the procedure definition block
-
Observe how only the top level if block remains. Instead the two if blocks should be connected in a stack.
Stack trace
No response
Screenshots
No response
To fix
- Pass
truehere. - Repeat the reproduction steps and ensure only the procedure call block is deleted, not all of its children
- Add a unit test as part of this suite that tests to ensure the child blocks of the caller are not deleted.
The dispose function takes an optional parameter that controls whether to "heal" the stack of blocks when one is deleted. If true, only the one block will be deleted and the child blocks of it will be connected to the deleted block's parent, if possible. If false (or unset, as here) the block and its children will be deleted.
If you'd like to work on this issue and you're new to Blockly / blockly-samples, there are some guidelines here. Comment on this issue if you'd like to work on it so we can assign it to you.