tobimori/streamdeck-toggl

Stopping/Polling not working

AdmiralMurtho opened this issue · 12 comments

At this Moment I can start an Time Tracking on MacOS 11.2.3 on an Mac mini m1 but the Button didn't change the color (Like I know it from Windows) and so I can't stop the tracking. Every time I push the same Trackingbutton the last one stop and the new tracking begin.

I am having the same issue, MacOS 11.3, MacBook Pro, Streamdeck XL 4.9.4 (had same issue on 4.9.3 before upgrading this morning)

I click the button and it changes to red and then immediately goes back to black. Restarted Streamdeck, recreated button, same behavior. Sometimes the tracker shows time in Toggl, sometimes it doesn't (inconsistent). Also, the timer never shows on the StreamDeck button in any instance.

I seem to be having this issue on Windows as well (although I just got the streamdeck today, so I have nothing to compare to). However I cannot stop tracking, and the button doesn't show time or stay red (although toggl shows it is tracking).

For correct stopping and polling, please make sure all settings are set: Entry Name, Workspace and Project. Try switching the profiles too, it should reinitialise all buttons.

that worked for me :)

I was having the same issue.
Had empty title, filled in label, workspace and project - but NOT entry name.
Adding a text in the entry name field made the button stay red when clicked and the timer to show up.

Very much looks like all fields should have values for the time to work, for example.

I'd argue that there are cases where entry name and/or project might be empty. Would still be nice to have a running timer.

This is being addressed in the rewrite.

Is the rewrite still happening?

I've just spent a day trying to get the polling working in the current version, but to no avail!

The interval between checks climbs/jumps from 5 seconds (or whatever it's set to) to various figures (15-60 seconds).

It happens even if I comment out the refreshButtons() call.

I've also tried replacing the delay from an inline Promise, to another function, to replacing it altogether with setInterval() and even having the plugin reload itself if the polling takes more than 10 seconds.

It feels almost like something inside Stream Deck is handling the timeouts/delays differently from a browser (perhaps to do with other plugins, or energy usage, or something?).

While writing this I thought about trying nested a setTimeout() instead of setInterval() - it's successfully polled 40 times quite consistently, which is better than I've managed so far! So I guess I'll see how that goes, now!

I think the issue in here is also related to the matching with the current running timer, happening here:
https://github.com/tobimori/streamdeck-toggl/blob/master/plugin/main.js#L130

When any value is not set, it fails to do so. Besides that, the random delays seemed to work fine.

I looked at that a little, as part of the other issue - but I have all the fields filled in so it shouldn't be affecting it on my machine. I'm not sure it's related to the polling itself, because the polling breaks down even if I disable the refreshButtons() completely.

I'm wondering if we should be leveraging background tasks/workers for the polling (and that may be what you've started on in the rewrite?). I've not worked with them yet though.

I looked at that a little, as part of the other issue - but I have all the fields filled in so it shouldn't be affecting it on my machine. I'm not sure it's related to the polling itself, because the polling breaks down even if I disable the refreshButtons() completely.

Sure, I was more asking if you could fix issues related to that too (if not all fields are filled) - because that's what the issue was about iirc.

Ah gotcha! Yes, I started having a look at that last night (then realised it might be good to get off the PC 🤣) but will have a dabble soon.

I've made a new issue, so this one can focus on the polling not working.