phetsims / forces-and-motion-basics

"Forces and Motion: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/forces-and-motion-basics
GNU General Public License v3.0
7 stars 10 forks source link

Recording on Win 10 Firefox not saved with back arrow #263

Closed KatieWoe closed 1 year ago

KatieWoe commented 5 years ago

For https://github.com/phetsims/QA/issues/187

While working on the recording part of step 3 of the above issue, firefox did not seem to save the data when the back button was used.

From instructions:

When you are done recording a session, try press the back button or exit out of the tab. You will be prompted if you want to leave the page. DON'T LEAVE (very important)!! Instead press "cancel". At this point a dialog will pop up that says "There is data not saved!". Wait for the progress bar to fully complete, and then you can safely leave the page. NOTE: if you try to leave the page while the progress bar is still "saving", nothing will stop you, but some data will be lost, so please stay until the progress bar reaches 100%, and the message changes to "Data Saved!".

When exiting out of the tab the wrapper performed as expected, but using the back arrow did not produce the dialog described.

KatieWoe commented 5 years ago

Update upon downloading recordings and playing back. This recording does seem to have made it with no problem. The dialog did not appear and there is no way to judge ahead of time it data was saved, but the recording was saved in this instance.

zepumph commented 5 years ago

Weirdly similar but different from https://github.com/phetsims/phet-io-wrappers/issues/15

@samreid I wonder if firefox handles the 'unload' event differently. Here is the code that should add the dialog:

                window.addEventListener( 'unload', function() {
                  console.log( 'Stopping Metacog' );
                  Metacog.stop();
                } );

Firefox really likes giving users control, so maybe there is a user setting where you have to opt in to a dialog appearing when you hit the back button.

@KatieWoe could you run another test for this issue, in which, while recording on the same system as noted above, you record a lengthy session (at least 5 minutes) with lots of events (perhaps let the box slide quickly forever on friction less ground), then press the back button and see if the recorded session is shorter than you would expect? (I know you are leaving soon, don't worry about it for today)

KatieWoe commented 5 years ago

@zepumph Just attempted to make a recording of 5 minutes on the same system. Can't tell if it saved. Will find out Monday.

KatieWoe commented 5 years ago

@zepumph just checked the recording. I recorded for 5 minutes. The time on the recording says 4:58 and it doesn't look like anything is missing from the recording from what I can tell.

zepumph commented 5 years ago

That's great news thanks. It is possible that this is in part because you have a good connection. Events that you are emitting are able to be sent to metacog with relative speed, such that the sending queue is relatively short.

Would it be possible to try to throttle your internet and then record again and see if the playback log is missing anything (note that if there is an error in the log, the playback wrapper will note it as such with an asterisk).

You can adjust your speed in a dropdown in the network tab: image

Also https://blog.nightly.mozilla.org/2016/11/07/simulate-slow-connections-with-the-network-throttling-tool/ may be helpful.

If after 5 minutes of emitting many events on a very slow connection, perhaps we will be more likely to trigger an error. If this doesn't break a session, then we may think tagging this issue as a won't fix.

KatieWoe commented 5 years ago

Interesting discovery while doing this test. I found that if you hit the back arrow once, the screen goes blank. Hitting the arrow a second time when the speed is throttled did bring up the warning message. It didn't before, which makes me think it finished before I hit it a second time. Not sure why it is two back arrows here, and not one. Still going to test the recording itself, but in the meantime this might help. @zepumph saving

zepumph commented 5 years ago

It sounds like we can safely say that this is a duplicate of https://github.com/phetsims/phet-io-wrappers/issues/15 then, but displaying symptoms with a fast internet connection.

KatieWoe commented 5 years ago

@zepumph just looked at the recording and it looks ok.

KatieWoe commented 5 years ago

Looks like this appears in https://github.com/phetsims/QA/issues/190 as well. Linking here.

samreid commented 1 year ago

We no longer support Metacog as a data storage/retrieval service, closing.