CSUFTitanRover / TitanRover2018

Titan Rover 2018 Edition: Calypso
http://titanrover.com/
Apache License 2.0
12 stars 10 forks source link

Issue with starting/stopping stopwatch #64

Closed Weffe closed 6 years ago

Weffe commented 6 years ago

Issue description

There is a potential issue when starting the stopwatch in a browser which starts an Interval for accumulating the time and immediately refreshing/closing the same browser. If you re-open the UI you should see that the stopwatch is active but there is no change to the actual time since the Interval was lost when the browser was refreshed/closed. This can be a problem because some of our teammates may have to refresh the browser to double-check camera streams are working properly or refresh the page for other reasons. (This user behavior actually happened during the test run at Craig park which is why I am creating this bug report)

Steps to reproduce the issue

  1. Start UI & Homebase Deepstream server
  2. Open UI in a browser
  3. Start the Stopwatch
  4. Refresh/Close the browser
  5. Re-open the browser

What's the expected result?

The time in the stopwatch should keep updating even if the browser with the Interval was refreshed/closed.

What's the actual result?

The time in the stopwatch ceased to keep updating with its new value even though the status of the stopwatch is set to active.

Possible Solution

A possible solution for this is to move the task of updating the stopwatch's value to a "server-side" node process. I say "server-side" for clarity sake but I really just mean running a node process on the homebase computer that hooks up to deepstream and listens for stopwatch activation/deactivation changes to update the time value. This alleviates the job of having an Interval in a browser update the stopwatch's time value and allows the UI to be refreshed/closed without the fear of losing usability.

Weffe commented 6 years ago

As we discussed today at our UI meeting, our agreed solution was to use the proposed solution that I made. It seems like the best way to avoid this issue.

Weffe commented 6 years ago

@bluesun212 This is up to you to fix since you know the code best and thought of a solution for this bug at our meeting today.