Closed phet-steele closed 6 years ago
I suspect this is a phet-io thing, since I don't think anything else has changed.
This issue does not occur when running in RequireJS mode from phetmarks, which doesn't include phet-io.
It is easily duplicated by launching instance-proxies, selecting instance-proxies, mirror-inputs, screenshot, and probably any of the other phet-io wrappers, then starting the game and completing a challenge. The assert statement is hit when the "Next" button is pressed.
I tried launching instance-proxies from the "index" page, and the problem did NOT occur.
Given that this only occurs in phet-io mode, and the assertion is in phetioEvents.js
, I think @samreid should take it from here and can bring me back in if needed.
Sounds good, thanks!
I tried launching instance-proxies from the "index" page, and the problem did NOT occur.
It looks like that mode does not include assertions, so it fails silently and likely disturbs the rest of the data stream.
When the "next" button is pressed, it changes the state and disposes the next button. The phetioEvents is expecting the state change message to end, but the button message ends first (because the button was disposed).
I cannot figure out whether (a) Build an Atom is doing something suspicious and PhET-iO is catching a potential problem or (b) PhET-iO is too restrictive and showing a false positive for this case.
Proposed solution committed above. I'd like @zepumph to take a closer look when he returns. Note that adding phetioEvents.stack as an instance variable, then using the console wrapper is helpful to understand what is happening.
@samreid I apologize I didn't get to this, leaving me assigned if it sits until Feb, otherwise back to you.
No worries, we can look at this on your return.
// N.B. That is to say, I don't really understand the problem nor why this solution works.
I agree and it doesn't bother me. We have run into these sorts of problems before where something disposes itself before the phet-io messaging can finish. This seems like a fine workaround until we go back to this simulation.
Complete a challenge (any?) on a game level (any?).