phetsims / buoyancy

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

Possible to drain water from the pool! #145

Closed AgustinVallejo closed 1 week ago

AgustinVallejo commented 3 weeks ago

When testing https://github.com/phetsims/buoyancy/issues/142 I thought I had introduced a bug, but it seems to have been there for a while. If you fuzz test only screen 5, it's possible to drain the pool from its contents. I have a hunch as to what could be the cause but have to investigate.

Image

AgustinVallejo commented 3 weeks ago

Found it! If in the Bottle scene you take the pool scale out, every time you switch scenes, some water is going to be missing.

zepumph commented 1 week ago

Likely because how this is behaving in non standard cases?

https://github.com/phetsims/density-buoyancy-common/blob/21fdf30579e3aeeb9b703598527dbf861f51a9b1/js/buoyancy/model/BuoyancyApplicationsModel.ts#L129-L133

AgustinVallejo commented 1 week ago

Pushed a fix and fuzz tested it. Seems to be working correctly now :)

phet-dev commented 1 week ago

Reopening because there is a TODO marked for this issue.