mcndt / obsidian-toggl-integration

A Toggl integration plugin for the popular knowledge base application Obsidian.
GNU General Public License v3.0
267 stars 19 forks source link

Timer is broken when started from Toggl website #126

Open Robyer opened 1 year ago

Robyer commented 1 year ago

I have visible Toggl Report panel in my Obsidian and found that when timer is started on website, the plugin will get into some broken state. Same problem happens when timer is running on a website and I restart Obsidian or remove and re-add the API key.

In this case:

Stopping the timer on Toggl website and then re-triggering the edit/preview of the toggl ... block will make it load correctly. Also the data in Toggl Report panel are then updated correctly.

Expected behavior:

mcndt commented 11 months ago

This is quite strange that you and at least two other users have reported this problem; when trying to reproduce this bug my Toggl web application and Obsidian client are perfectly in sync (+-1-5 seconds to sync since I am only allowed to poll the Toggl API at a lower rate than the web app).

Could you provide some more context? Does this issue occur after you restarted Obsidian, or only if Obsidian has been open for >24 hours?

Robyer commented 11 months ago

@mcndt This issue is always easily reproducible for me. It happens all the time, it doesn't matter whether Obsidian has been running or if it is freshly (re)started. To reproduce: 1) Make sure Toggl Track timer is stopped 2) Start Obsidian with this plugin (I have it visible on the sidebar) 3) On Toggl Track website start timer 4) In few seconds Obsidian plugin will recognize that something has changed and update the value in panel once to like "Today: 0:00:03" and since this moment becomes stuck.

Or: 1) Make sure Obsidian is not running 2) Start the timer on Toggl Track website 3) Start the Obsidian 4) Situation is now same as above. Timer is stuck.

Stuck means:

Now if I stop the timer on Toggl Track website, the timer in panel still shows the same value "Today: 0:00:03" but after few seconds I can correctly open the note. At this point it correctly loads and shows the graphs and also updates the timer in the panel (for example to "Today: 0:00:45". Without opening the note the timer panel is never updated.

mcndt commented 11 months ago

Can you tell me your plugin version, Obsidian version (and launcher version), and your platform (Mobile, Windows, MacOS, ...)?

Robyer commented 11 months ago

Before writing my previous comment and testing it I updated to the new version of plugin (0.11.0). So it is same in this version and previous one. I use Obsidian 1.3.5 (both installer version and app version) - the AppImage variant - on standard Ubuntu 23.04.

Robyer commented 11 months ago

I just tried it on Windows 11 too (same Obsidian and plugin version) and the issue is the same.

BassWasTaken commented 9 months ago

I also have this issue, but to be honest so far I've had similar issues with (almost) all toggl apps, widgets etc. I can usually rely on using toggl via the website, and via the official mobile app. Anything else I've used (this includes the homescreen widgets for the app) can run into sync issues where one or the other just seems to not get the memo when a new timer is started. This is particularly the case when one or the other has been offline. (e.g. after booting up my pc from sleep mode, I always need to restart Toggl.)

Anyway, my point is: I rather suspect it might just be that Toggl's API kind of sucks, a bit? And thus it might not be anything you can fix on your side.