phetsims / gas-properties

"Gas Properties" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 6 forks source link

Particle location while paused fails to update when setting state for the second time #276

Open Nancy-Salpepi opened 1 week ago

Nancy-Salpepi commented 1 week ago

Test device MacBook Air M1 chip

Operating System 14.5

Browser Safari 17.5

Problem description For https://github.com/phetsims/qa/issues/1100, and possibly related to https://github.com/phetsims/gas-properties/issues/269 in the State Wrapper on all screens, the first time I set state with the sim paused, the state of the particles in the downstream sim matches the upstream. If I unpause the upstream sim and allow the particles to move a bit before pausing again, the downstream sim will not match the upstream sim when setting state. Everything else does update (the graphs, pressure, temperature etc). Once I press play, the particles in the downstream sim update. On Reset All the state is correctly set. This also happens whens I resize the container. It will not update the second time I set state.

Steps to reproduce Here is an example:

  1. In the State Wrapper, set state rate = 0
  2. In the upstream sim on the Ideal Screen add a bunch of particles and then hit Pause
  3. Press Set State Now
  4. In the upstream sim, press Play
  5. After the particles have obviously changed locations, press Pause
  6. Press Set State Now

Visuals

https://github.com/phetsims/gas-properties/assets/87318828/e252a7c1-f86d-4f39-bc44-42f5e48d0761

Screenshot 2024-06-24 at 2 02 16 PM
KatieWoe commented 1 week ago

I see this in the 4th screen as well. pausedstate

pixelzoom commented 4 days ago

Reproduced in main.

Note that #276 and #280 are both bad State Wrapper behavior when the sim is paused, and both related to the position of particles.

This is probably related to incorrect or missing use(s) of isSettingPhetioStateProperty, in relation to isPlayingProperty.