mcndt / obsidian-toggl-integration

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

Sidebar list periodically clears and only current activity shows #34

Closed macbikegeek closed 2 years ago

macbikegeek commented 2 years ago

The sidebar list of activities periodically clears during the day and only current activity shows. It's intermittent and I haven't determined a trigger that causes it.

Minor but it would be nice if the list stay. Love the plugin!

mcndt commented 2 years ago

@macbikegeek Thanks for reporting this bug! Could you add a screenshot of the bug to this thread the next time it occurs for you? I use the plugin daily myself and I have not encountered this bug yet, so I need some help to pin this one down.

macbikegeek commented 2 years ago
Screen Shot 2021-11-03 at 2 32 38 PM Screen Shot 2021-11-03 at 11 49 51 PM

From Obsidian console: Case 2: old timer -> new timer (new ID) 2TogglManager.ts:311 Case 3: timer details update (same ID) 2TogglManager.ts:301 Case 2: old timer -> new timer (new ID) 2TogglManager.ts:311 Case 3: timer details update (same ID) 2TogglManager.ts:301 Case 2: old timer -> new timer (new ID) 3TogglManager.ts:311 Case 3: timer details update (same ID) 2TogglManager.ts:301 Case 2: old timer -> new timer (new ID) TogglManager.ts:311 Case 3: timer details update (same ID) TogglManager.ts:301 Case 2: old timer -> new timer (new ID) TogglManager.ts:311 Case 3: timer details update (same ID) TogglManager.ts:301 Case 2: old timer -> new timer (new ID) 2TogglManager.ts:311 Case 3: timer details update (same ID) 2TogglManager.ts:301 Case 2: old timer -> new timer (new ID) TogglManager.ts:311 Case 3: timer details update (same ID) TogglManager.ts:301 Case 2: old timer -> new timer (new ID) TogglManager.ts:311 Case 3: timer details update (same ID) TogglManager.ts:318 Case 4: active timer -> no timer TogglManager.ts:296 Case 1: no timer -> active timer client.js:86 Uncaught (in promise) Error: Toggl API responded with status code 502. Response:

502 Bad Gateway

502 Bad Gateway


nginx

at TogglClient.request (eval at <anonymous> (app.js:1), <anonymous>:9345:13)
at async TogglClient.get (eval at <anonymous> (app.js:1), <anonymous>:9324:12)
at async TimeEntries.current (eval at <anonymous> (app.js:1), <anonymous>:9048:20)

TogglManager.ts:311 Case 3: timer details update (same ID) TogglManager.ts:301 Case 2: old timer -> new timer (new ID) TogglManager.ts:311 Case 3: timer details update (same ID) TogglManager.ts:301 Case 2: old timer -> new timer (new ID) 4TogglManager.ts:311 Case 3: timer details update (same ID) TogglManager.ts:301 Case 2: old timer -> new timer (new ID)

cansar commented 2 years ago

I had this issue yesterday (first day with the plugin). I'll keep an eye on it today and report any error logs if it happens again.

Also, thank you for creating this, it's exactly what I'd been looking for for years.

mcndt commented 2 years ago

Funnily enough I just encountered this issue for the first time myself as I am making frequent API requests while developing report blocks (#27). I think I know what the issue is, so I'll try to write a fix and add it in the next release.

The gist of it is that I don't handle failing API requests gracefully causing the display to go empty until the next request. The frequency at which this occurs is of course entirely dependent on how well your machine can reach the Toggl servers, which is why I hadn't seen it yet.

macbikegeek commented 2 years ago

Thanks, @mcndt! Glad you found the issue.

mcndt commented 2 years ago

I think I fixed the issue, although I cannot verify it because I don't have the proper tooling set up to mess with the API requests.

Don't hesitate to reopen the issue if you still encounter this bug!

macbikegeek commented 2 years ago

@mcndt I had the problem showing when I got the email for your fix notice. I updated the plugin and restarted Obsidian and the problem has not recurred. Thanks! Lee