track-extension icon indicating copy to clipboard operation
track-extension copied to clipboard

"Stop timer automatically" feature issue on Windows

Open VeljkoTN opened this issue 3 years ago • 13 comments

  • 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:

  1. Get the Track extension
  2. Enable the "Stop timer automatically" feature
  3. Leave a timer running
  4. Close your browser

Other details or context

Intercom reference

VeljkoTN avatar Dec 07 '20 12:12 VeljkoTN

Case reference

dianetoggl avatar Dec 14 '20 02:12 dianetoggl

Cannot reproduce on macOS. Dont have a Windows machine to try it on. Time was stopped after closing ALL chrome windows. Screen Shot 2021-01-11 at 2 45 35 PM

almirbi avatar Jan 11 '21 13:01 almirbi

@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

VeljkoTN avatar Jan 11 '21 14:01 VeljkoTN

Maybe someone with Windows should try to take on this one 🤔 I don't think it's possible to try this on browserstack.

almirbi avatar Jan 11 '21 14:01 almirbi

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.

Phenome avatar Jan 11 '21 14:01 Phenome

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.)

leafi avatar Feb 12 '21 13:02 leafi

Case reference

dianetoggl avatar Nov 25 '21 21:11 dianetoggl

Shouldn't this issue be moved to https://github.com/toggl/track-extension-core ?

hazem3500 avatar Jan 10 '22 10:01 hazem3500

Case reference

nidarasheed avatar Feb 03 '22 10:02 nidarasheed

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

marksteve avatar Mar 03 '22 10:03 marksteve

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 avatar Mar 28 '22 12:03 langri-sha

@langri-sha I have this PR with the not so pretty solution: https://github.com/toggl/track-extension-core/pull/132

marksteve avatar Mar 28 '22 14:03 marksteve

This is still the issue. I am using Linux Firefox with extension version 3.0.29.

DivineMK avatar Apr 09 '24 14:04 DivineMK