Closed jessegreenberg closed 3 months ago
THis was observed in phet-creator-sims > electric-field-hockey project.
I can reproduce this pretty easily by doing this:
1) Create a new project 2) Create the "Described Grid" template. 3) Delete the "Movable Cupcake" and "Movable Object" programs. 4) Create the "Described Grid" template again.
There will now be two "Bounds" programs and BOTH will have connections to the "Movable Object" program. That is not correct, only the newest "Bounds" program should have any connections.
EDIT:
After saving the project in this buggy state, reloading it shows the correct connections. So I believe this could just be an issue with the arrows display and not the connections themselves.
EDIT2: It actually is a connections problem. It seems that the description view component from the deleted "Movable Object" component is NOT getting removed from CreatorModel.allViewComponents
Fixed in the above commit. Deleting a program actually did not remove components from the CreatorModel components lists. I am actually surprised that this didn't manifest in bigger problems.
Lets add some unit tests for this before closing.
Done and merged into main.
While in a demo today, extra connections were made from a template that we didn't expect. We created from the "described grid" template. Ill investigate why that happened.
I believe relationships between components were not removed correctly and so they were set up immediately again when the component was added.