Closed jessegreenberg closed 2 years ago
Showing up in several sims, molarity, gravity-force-lab-basics, waves-intro, probably others.
I have not yet been able to reproduce with fuzz testing locally.
The assertion hit in this case is in ParallelDOM.alertDescriptionUtterance
https://github.com/phetsims/scenery/blob/0a57ff86efd38daf0fdfbcc89cbf332e39982764/js/accessibility/pdom/ParallelDOM.ts#L2631-L2636
The call to that function is in a listener on a Property, linked in PreferencesToggleSwitch. If the Property changes after the PreferencesToggleSwitch is removed from the display we will hit this.
I let molarity, color-vision, gravity-force-lab-basics, and waves-intro fuzz for 20 minutes and did not hit this error. But surprisingly, I found a way to reproduce easily.
Open the PreferencesDialog to a tab with a PreferencesToggleSwitch With one finger press on a PreferencesToggleSwitch With another finger tap outside of the dialog, it will close Release the first finger -> this will cause the assertion
I found this is happening because the listener on from the ToggleSwitch
is still attached to the Pointer after the Dialog is closed from another input. I think this is fixed if we add an interruptSubtreeInput()
before hiding the Popupable
.
OK, that does fix the problem. @kathy-phet can you please assign a reviewer for a change in Popupable? Listed authors are
@author Jonathan Olson <jonathan.olson@colorado.edu>
@author Sam Reid (PhET Interactive Simulations)
@author Andrea Lin (PhET Interactive Simulations)
@author Chris Malley (PixelZoom, Inc.)
Over slack @samreid said
That sounds correct to me
This was a one-line addition, maybe that is sufficient for review?
I reviewed the commit and wrote up a way to get rid of the as unknown as
parts. Can you please review?
Also, can you please describe a scenario where it is easy to test this change? Is there a Popupable dialog with a slider or something draggable, for instance?
That is awesome, I pushed the change. Id like to do that for our other traits too. See https://github.com/phetsims/scenery/issues/1498
an you please describe a scenario where it is easy to test
Yes, the case were I could easily break things before this change is in https://github.com/phetsims/joist/issues/881#issuecomment-1311976590.
I reverted https://github.com/phetsims/sun/commit/9f22e81fbf572672f06cc456c2c6ad75a1522746, cleared my mobile safari cache and ran Gravity and Orbits with ?ea. I was able to continue dragging the projector mode toggle button after dismissing the dialog, but the sim did not crash. I was not connected to remote debugging. So it was puzzling why the sim didn't crash.
Then I applied https://github.com/phetsims/sun/commit/9f22e81fbf572672f06cc456c2c6ad75a1522746 and cleared my mobile cache and saw that dragging the projector mode toggle button no longer continued after dismissing the dialog, so this seems like a good solution.
The commit seems good, so I think this issue can be closed.