phetsims / energy-forms-and-changes

"Energy Forms And Changes" is an educational simulation in HTML5, by PhET Interactive Simulations.
MIT License
5 stars 5 forks source link

Document why removal must be guarded, or remove the guard #403

Open samreid opened 3 years ago

samreid commented 3 years ago

In https://github.com/phetsims/axon/issues/332 we removed the guard from createObservableArray removal methods. I added a sim-specific guard in the following commit, but I'm not sure if it should be documented or eliminated. Assigning to responsible dev to take a look:

https://github.com/phetsims/energy-forms-and-changes/commit/5cae5efcae680c26095b7726e5a270913791844d https://github.com/phetsims/energy-forms-and-changes/commit/60f5612b872f6dc23de8db70d82ce5bb883fa6b5

samreid commented 3 years ago

Another problem of this type appeared on CT.

energy-forms-and-changes : fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/energy-forms-and-changes/energy-forms-and-changes_en.html?continuousTest=%7B%22test%22%3A%5B%22energy-forms-and-changes%22%2C%22fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1607341314522%22%2C%22timestamp%22%3A1607342196340%7D&brand=phet&ea&fuzz&memoryLimit=1000
Query: brand=phet&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed: item not found in Array
Error: Assertion failed: item not found in Array
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/assert/js/assert.js:25:13)
at arrayRemove (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/phet-core/js/arrayRemove.js:19:13)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/axon/js/createObservableArray.js:349:34
at Proxy.forEach (<anonymous>)
at Proxy.removeAll (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/axon/js/createObservableArray.js:349:14)
at Biker.extractOutgoingEnergyChunks (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/energy-forms-and-changes/js/systems/model/EnergySource.js:52:26)
at SystemsModel.stepModel (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/energy-forms-and-changes/js/systems/model/SystemsModel.js:261:42)
at SystemsModel.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/energy-forms-and-changes/js/systems/model/SystemsModel.js:245:12)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/joist/js/Sim.js:282:22
at Action.execute (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1607341314522/axon/js/Action.js:225:18)
id: Bayes Chrome
Snapshot from 12/7/2020, 4:41:54 AM
chrisklus commented 1 year ago

Leaving this issue unassigned until work on this sim is scheduled