Closed KatieWoe closed 4 years ago
This is phet-io-related, so off to @zepumph it goes.
Thanks. This has come up as a result of https://github.com/phetsims/phet-io/issues/1668, and is very nice to see, as it means an assertion is working as exposing potentialy pre-existing state problems. I dove into this briefly and didn't find it to be an easy fix.
Things to note for later in the week when I have time to devote to it:
PhetioDynamicElementContainer
undeferring notifications and PhetioGroup
asserting countProperty length based on the same emitter.Trajectory
who's notification is being flushed when undeferring, instead of eagerly during stateProcessor step. This makes sense, and potentially is fine, but we should investigate if that is the desired behavior.Count is consistently 1, and the array length is 3.
The first numbers I just got when coming back to this was 3 and 4. . .
Wow. I finally found the issue, but it took a bit to figure out how to find the problem. Steps to reproduce if you remove the above commit:
phetioStateEngine.mostRecentSavedState
, because it wasn't enough to just have the state, it was the combination of the current state and the state to be setting to. mostRecentSavedState
, and then sets the next state. This made for an easily reproduceable caseI will keep this open and make sure CT is clear tomorrow.
Looks fixed on CT!