phetsims / paper-land

Build and explore multimodal web interactives with pieces of paper!
https://phetsims.github.io/paper-land/
MIT License
19 stars 3 forks source link

Deleting (or renaming?) a reference component causes connected Speech component to fail assertion #256

Closed brettfiedler closed 6 months ago

brettfiedler commented 6 months ago

https://github.com/phetsims/paper-land/assets/47331395/835cea58-b629-4f3a-8120-da086916bd34

Steps to reproduce:

jessegreenberg commented 6 months ago

I am a little confused, I see that neither model and reference components are removed when a model component is deleted. This is taken while trying to save to a view component after I deleted nameResponse (a reference component) in my test.

image

I expected nameResponse to already be removed at this point.

jessegreenberg commented 6 months ago

Yes, there is definitely a related bug here. Steps:

1) Create a view component with a dependency on a model component. 2) Delete the model component. 3) Send to playground. 4) Note that the deleted model component will be referred to in the generated code for the view component.

When a dependency is deleted, it should auto-remove itself from components that depend on it.

jessegreenberg commented 6 months ago

This has been fixed for the view component, but several other components will have the same problem:

jessegreenberg commented 6 months ago

OK, this has been fixed for the various cases where this is possible.

Unit tests have been added to verify for each of the identified components above.

Merged into main. Closing.