openroberta-lab icon indicating copy to clipboard operation
openroberta-lab copied to clipboard

Blockly name connection not working properly when typing invalid names.

Open heini208 opened this issue 3 years ago • 0 comments

Describe the bug

  • When entering an invalid name into the textbox of a sensor or actor that is connected to a action block in the program workspace the last viable text gets added to the list of sensors/actors you can choose in the action blocks drop-down menu.
  • this causes more sensors to choose from then there are actually in the configuration To Reproduce Steps to reproduce the behavior:
  1. Go to Program of a robot using the new config
  2. pull out an action block that has a variable port field which is connected to the configuration
  3. pull out the corresponding block in the configuration
  4. change the name to something invalid and press enter
  5. switch back to program
  6. click drop-down of the added block
  7. see issue

Expected behavior

  • when changing T to test....(invalid) test should not be added to the list of available blocks to choose in the program, instead only T should remain in the drop-down menu

Screenshots grafik

Additional context

  • I have partially fixed this issue in this(WIP) PR by changing this to: if (dropDown[d].menuGenerator_[i][1] === oldName || subComponentNames.has(dropDown[d].menuGenerator_[i][1])) {
  • however this only fixes the issue for every time the name is changed to something invalid except from the original name, which is arguably the most important time.
  • this issue seems to be caused by this from the validator of the configuration blocks, removing it resolves the issue completely but i have not looked further into why that causes the issue and why it is needed here.
  • Special attention should be payed to the calli:bot which seems to have the most issues regarding this bug

heini208 avatar Oct 14 '21 10:10 heini208