phetsims / gravity-force-lab-basics

A simplified version of PhET's "Gravity Force Lab" simulation, intended for use with younger students.
GNU General Public License v3.0
3 stars 4 forks source link

CT update should only be necessary if node already has focus #287

Closed KatieWoe closed 3 years ago

KatieWoe commented 3 years ago
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/gravity-force-lab-basics/gravity-force-lab-basics_en.html?continuousTest=%7B%22test%22%3A%5B%22gravity-force-lab-basics%22%2C%22multitouch-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1626252559458%22%2C%22timestamp%22%3A1626268406469%7D&brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false
Query: brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false
Uncaught Error: Assertion failed: update should only be necessary if node already has focus
Error: Assertion failed: update should only be necessary if node already has focus
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/assert/js/assert.js:25:13)
at HighlightOverlay.onFocusHighlightChange (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/scenery/js/overlays/HighlightOverlay.js:628:15)
at TinyEmitter.emit (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/axon/js/TinyEmitter.js:86:9)
at GFLBMassNode.setFocusHighlight (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/scenery/js/accessibility/pdom/ParallelDOM.js:1470:45)
at GFLBMassNode.set focusHighlight [as focusHighlight] (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/scenery/js/accessibility/pdom/ParallelDOM.js:1473:51)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/gravity-force-lab/js/view/MassNode.js:69:27
at TinyProperty.emit (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/axon/js/TinyEmitter.js:86:9)
at DerivedProperty._notifyListeners (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/axon/js/Property.js:271:23)
at DerivedProperty.set (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/axon/js/Property.js:186:14)
at DerivedProperty.getDerivedPropertyListener (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1626252559458/axon/js/DerivedProperty.js:112:13)
id: Bayes Chrome
Snapshot from 7/14/2021, 2:49:19 AM
jessegreenberg commented 3 years ago

Was able to produce locally in a case of multitouch, which makes sense from the CT query

brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false

To reproduce, enable "Interactive Highlights", then start dragging a mass with one finger while increase the mass of the grabbed sphere with another. This will cause the mass size to change and therefore the focus highlight to change. But the dragged object does not have focus, causing the assertion.

jessegreenberg commented 3 years ago

I think the proper fix for this is to be able to set multiple different highlights, which is also required for friction.

jessegreenberg commented 3 years ago

This should be fixed by https://github.com/phetsims/scenery/issues/1274