ActivityWatch / aw-watcher-window

Cross-platform window watcher (for use with ActivityWatch)
Mozilla Public License 2.0
83 stars 51 forks source link

feat: added hybrid polling method for macOS #95

Closed ErikBjare closed 8 months ago

ErikBjare commented 8 months ago

This implements the hybrid polling mechanism that augments the events-based method with a 10s poll, as we've discussed before (https://github.com/ActivityWatch/aw-watcher-window/pull/69#issuecomment-1264419382).

This fixes bugs where if the starting/ending event is missed, and would've created a long continuous event, that period of time would be lost.

I generated this with gptme running GPT-4.

No idea if it works or not, but doesn't crash anyway.

It didn't work at first, but it works great now! (after 1min of testing)

ErikBjare commented 8 months ago

@iloveitaly @modderme123 This seems to fix lots of issues I've had with gaps in the data.

Please give it a review, I want to merge and release a new beta with it asap :)

ErikBjare commented 8 months ago

After a few days of testing, it seems solid, and fixes quite a few issues with the previous implementation.

@iloveitaly @modderme123 Feel free to still give it a review post-merge :)

iloveitaly commented 8 months ago

NICE! Glad this is finally getting fixed. Thank you!