-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Labels
component: functionscomponent: variablesissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong
Milestone
Description
Describe the bug
If you rename a variable via a variable block, it can cause duplicate variables in a procedure.
To Reproduce
Steps to reproduce the behavior:
- Create a mutator with two variables.
- Grab a variable block for one of the variables.
- Rename the variable to match the other variable in the mutator.
- Observe how there are duplicate vars in the procedure. (bad)
The next bit does not always happen, depending on which var you rename:
- Open the mutator.
- Observe how you have two vars.
- Close the mutator and reopen.
- Observe how you get errors in the console.
Expected behavior
There are two parts:
- Duplicate vars: No clue how this should be handled.
- Errors: Errors are bad, definitely do not want errors.
Screenshots
Desktop (please complete the following information):
- OS: Ubunto 18.04
- Browser Chrome
- Version 80
Stack Traces
procedures.js:110 Uncaught TypeError: Cannot read property 'name' of null
at Blockly.BlockSvg.mutationToDom (procedures.js:110)
at Object.Blockly.Procedures.mutateCallers (procedures.js:374)
at Blockly.BlockSvg.compose (procedures.js:227)
at Blockly.Mutator.workspaceChanged_ (mutator.js:377)
at Blockly.WorkspaceSvg.Blockly.Workspace.fireChangeListener (workspace.js:657)
at Blockly.Events.fireNow_ (events.js:192)
mutationToDom @ procedures.js:110
Blockly.Procedures.mutateCallers @ procedures.js:374
compose @ procedures.js:227
Blockly.Mutator.workspaceChanged_ @ mutator.js:377
Blockly.Workspace.fireChangeListener @ workspace.js:657
Blockly.Events.fireNow_ @ events.js:192
setTimeout (async)
Blockly.Events.fire @ events.js:174
Blockly.Mutator.setVisible @ mutator.js:274
Blockly.Icon.iconClick_ @ icon.js:124
Blockly.Mutator.iconClick_ @ mutator.js:124
wrapFunc @ blockly.js:462
variables.js:51 Uncaught TypeError: Cannot read property 'getId' of null
at Object.Blockly.Variables.allUsedVarModels (variables.js:51)
at Object.Blockly.Xml.workspaceToDom (xml.js:38)
at exportWorkspace (my_playground.html:438)
at autoUpdater (my_playground.html:561)
at Blockly.WorkspaceSvg.Blockly.Workspace.fireChangeListener (workspace.js:657)
at Blockly.Events.fireNow_ (events.js:192)
Blockly.Variables.allUsedVarModels @ variables.js:51
Blockly.Xml.workspaceToDom @ xml.js:38
exportWorkspace @ my_playground.html:438
autoUpdater @ my_playground.html:561
Blockly.Workspace.fireChangeListener @ workspace.js:657
Blockly.Events.fireNow_ @ events.js:192
setTimeout (async)
Blockly.Events.fire @ events.js:174
Blockly.Mutator.setVisible @ mutator.js:274
Blockly.Icon.iconClick_ @ icon.js:124
Blockly.Mutator.iconClick_ @ mutator.js:124
wrapFunc @ blockly.js:462
procedures.js:110 Uncaught TypeError: Cannot read property 'name' of null
at Blockly.BlockSvg.mutationToDom (procedures.js:110)
at Object.Blockly.Procedures.mutateCallers (procedures.js:374)
at Blockly.BlockSvg.decompose (procedures.js:202)
at Blockly.Mutator.setVisible (mutator.js:292)
at Blockly.Mutator.Blockly.Icon.iconClick_ (icon.js:124)
at Blockly.Mutator.iconClick_ (mutator.js:124)
at SVGGElement.wrapFunc (blockly.js:462)
mutationToDom @ procedures.js:110
Blockly.Procedures.mutateCallers @ procedures.js:374
decompose @ procedures.js:202
Blockly.Mutator.setVisible @ mutator.js:292
Blockly.Icon.iconClick_ @ icon.js:124
Blockly.Mutator.iconClick_ @ mutator.js:124
wrapFunc @ blockly.js:462
variables.js:51 Uncaught TypeError: Cannot read property 'getId' of null
at Object.Blockly.Variables.allUsedVarModels (variables.js:51)
at Object.Blockly.Xml.workspaceToDom (xml.js:38)
at exportWorkspace (my_playground.html:438)
at autoUpdater (my_playground.html:561)
at Blockly.WorkspaceSvg.Blockly.Workspace.fireChangeListener (workspace.js:657)
at Blockly.Events.fireNow_ (events.js:192)
Additional context
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component: functionscomponent: variablesissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong

