Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer is broken when started from Toggl website #126

Open
Robyer opened this issue Apr 11, 2023 · 6 comments
Open

Timer is broken when started from Toggl website #126

Robyer opened this issue Apr 11, 2023 · 6 comments

Comments

@Robyer
Copy link

Robyer commented Apr 11, 2023

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:

  • timer in panel does nothing, looks as if it's stopped
  • any other requests to the API are probably stuck - when I edit the note containing the toggl ... block, it also gets stuck in "editing mode" or in "Loading Toggle report..." state.

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:

  • I would expect that plugin recognizes when timer is started on Website and acts accordingly. Note that when timer is enabled from Obsidian, it recognizes if it is stopped on the website. It just doesn't recognize the start, and gets stuck.
@mcndt
Copy link
Owner

mcndt commented Jul 23, 2023

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
Copy link
Author

Robyer commented Jul 23, 2023

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

  • timer in panel is not being updated anymore, is still at "Today: 0:00:03"
  • if I try to open my note with toggl ... block inside, obsidian shows error Failed to load "note.md". Cannot read properties of undefined (reading 'p') without opening the note.
    • if I had the note opened before I started the timer on Toggl Track website, it will stay open but will be stuck in "editing mode" or in "Loading Toggle report" state.

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
Copy link
Owner

mcndt commented Jul 24, 2023

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

@Robyer
Copy link
Author

Robyer commented Jul 24, 2023

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
Copy link
Author

Robyer commented Jul 24, 2023

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

@BassWasTaken
Copy link

BassWasTaken commented Sep 14, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants