Skip to content

Disposing of a procedure definition disposes caller *and* next blocks #2217

@BeksOmega

Description

@BeksOmega

Check for duplicates

  • 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

  1. Create the following arrangement in the sharable procedures demo
    image

  2. Delete the procedure definition block

  3. 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

  1. Pass true here.
  2. Repeat the reproduction steps and ensure only the procedure call block is deleted, not all of its children
  3. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions