phetsims / expression-exchange

"Expression Exchange" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

TypeError: Cannot read property 'destinationProperty' of undefined #77

Closed phet-steele closed 7 years ago

phet-steele commented 7 years ago
TypeError: Cannot read property 'destinationProperty' of undefined
    at Expression.updateSizeAndCoinTermPositions (https://bayes.colorado.edu/continuous-testing/snapshot-1492045566033/expression-exchange/js/common/model/Expression.js?bust=1492093134092:353:61)
    at Expression.step (https://bayes.colorado.edu/continuous-testing/snapshot-1492045566033/expression-exchange/js/common/model/Expression.js?bust=1492093134092:247:14)
    at https://bayes.colorado.edu/continuous-testing/snapshot-1492045566033/expression-exchange/js/common/model/ExpressionManipulationModel.js?bust=1492093134092:679:22
    at Array.forEach (native)
    at ObservableArray.forEach (https://bayes.colorado.edu/continuous-testing/snapshot-1492045566033/axon/js/ObservableArray.js?bust=1492093134092:305:27)
    at ExpressionManipulationModel.step (https://bayes.colorado.edu/continuous-testing/snapshot-1492045566033/expression-exchange/js/common/model/ExpressionManipulationModel.js?bust=1492093134092:678:26)
    at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/snapshot-1492045566033/joist/js/Sim.js?bust=1492093134092:764:24)
    at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/snapshot-1492045566033/joist/js/Sim.js?bust=1492093134092:699:14)
Approximately 4/12/2017, 7:06:06 PM
jbphet commented 7 years ago

This was occurring during fuzz testing. As best I can tell, fuzz testing could create a race condition where a coin term was added or removed from an expression and the expression animated to the point where it joined another expression all during a single step. I tried for a while and couldn't duplicate it manually, but I was able to duplicate during fuzz testing and examine the state of the code. By moving the animation to the end of the step function, race conditions such as this can be avoided because the coin terms won't have been removed when the animation is stepped. So, this should be fixed. Back to @phet-steele to verify on master.

jbphet commented 7 years ago

By the way, this was introduced recently when the TWEEN animations were replaced, see #39.

phet-steele commented 7 years ago

Bayes has not been reporting the error, we should be good here!