invoiceninja/ui

Running task live timer does not use the real system clock, gets out of sync on time warps after suspend/resume

Closed this issue · 1 comments

In the v5 pro SaaS version, I will typically leave the task editor UI opened in a browser window (specifically, Epiphany's web app mode) while I'm meeting with a client, by clicking that "play" button:

image

During that time, it is extremely likely that my computer (whether the desktop workstation in the office, or my laptop in the field, etc.) will either auto-suspend to RAM (after a certain amount of idle time, or on lid close), lose the internet connection when leaving wifi or losing a hotspot, etc.

The problem is, when I come back to it and wake+reconnect the computer, the webpage's live timer is apparently still running, but the time count is wrong, as it only incremented time while the page was actively displayed by the computer.


Workaround: Reloading the task's page shows the correct running time and then I can stop the live timer, but it would be nicer if the live timer was always correct even when there has been a system "time jump".

Potential caveat I could imagine: watch out for system timezone changes though, if for example someone timelogs their travel time across different countries on a sufficiently fast means of transportation ;) it might be best to rely on the server's reported UTC time (during live timing only) rather than the local browser's time.

@nekohayo thanks for reporting.