track-extension
track-extension copied to clipboard
"Stop timer automatically" feature issue on Windows
- OS version: Windows 10
- Browser version: 87.0.4280.88
- Extension version: Version 1.67.1
🐛 Describe the bug
With the "Stop timer automatically" feature enabled, the running timer does not stop when you close your browser. ON WINDOWS.
Expected behaviour
Any running timer should be stopped when you close your browser if the "Stop timer automatically" feature is enabled on the settings page for the extension.
Steps to reproduce
Steps to reproduce the behaviour:
- Get the Track extension
- Enable the "Stop timer automatically" feature
- Leave a timer running
- Close your browser
Other details or context
Cannot reproduce on macOS. Dont have a Windows machine to try it on. Time was stopped after closing ALL chrome windows.
@almirbi I just tried it on Chrome/Windows and it didn't stop after closing the browser (so all tabs). I have two desktops so made sure to only use one as well where I have chrome running to make sure and the same thing happens.. closing the browser does not stop a running timer
Maybe someone with Windows should try to take on this one 🤔 I don't think it's possible to try this on browserstack.
Can reproduce.
Tried on Windows with both an already running TE, and then with a TE created from Track Extension itself.
Also tried chrome://restart
, and made sure there were no more chrome processes running after close.
This doesn't work on Linux, either. At least not for a simple 1 window session in Chromium - I could never get it to automatically stop the timer.
(Reproduced in a Windows VM, too.)
Shouldn't this issue be moved to https://github.com/toggl/track-extension-core ?
I was also able to replicate the issue in macOS so I don't think it's a platform issue. It seems that neither the onbeforeunload
nor the browser.windows.onRemoved
event is reliable enough to submit the stop time entry API request. Tried the browser.runtime.onSuspend
event but that doesn't trigger at all. I experimented with the Beacon API, which is supposedly meant for submitting requests before unload, but even that wasn't able to trigger in time.
Video of closing the browser with the extension failing to send a request: https://user-images.githubusercontent.com/26679/156544586-648cfc20-5a54-4f04-9224-62e4f8441bde.mp4
Video of closing the browser with the extension successfully sending a request because a DevTool console window is left open: https://user-images.githubusercontent.com/26679/156543194-a301fd17-6b69-4808-8342-0ff28e959d61.mp4
I guess we didn't really figure out where to go with this. I believe we said something about leaving a note that this option isn't reliable.
@langri-sha I have this PR with the not so pretty solution: https://github.com/toggl/track-extension-core/pull/132
This is still the issue. I am using Linux Firefox with extension version 3.0.29.