jazzband / Watson

:watch: A wonderful CLI to track your time!
http://tailordev.github.io/Watson/
MIT License
2.46k stars 240 forks source link

Report calculates wrong totals #505

Open hinricht opened 10 months ago

hinricht commented 10 months ago

I'm using watson for quite a while now and was happy with it so far! But just now I noticed that the calculated totals reported by watson report were completely off for the last week I worked in 2023:

$ watson log --from 2023-12-18 --to 2023-12-22
Monday 18 December 2023 (6h 25m 44s)
    9e2e084  08:55 to 15:20   6h 25m 44s  project1

Tuesday 19 December 2023 (6h 09m 00s)
    386e1a5  10:00 to 16:09   6h 09m 00s  project1 [sick]

Wednesday 20 December 2023 (6h 34m 16s)
    ae4f5bf  09:35 to 16:09   6h 34m 16s  project1

Thursday 21 December 2023 (5h 24m 26s)
    7732b0e  09:18 to 14:43   5h 24m 26s  project1

So far so good, roughly 24,5 hours by estimation. But watson report tells me 57,5 hours !

$ watson report --from 2023-12-18 --to 2023-12-22
Mon 18 December 2023 -> Fri 22 December 2023

project1 - 57h 23m 25s
    [sick 6h 09m 00s]

Total: 57h 23m 25s

I am staring at the results for some time and can't figure out what's happening ...?

It also gets even weirder, by every day I increase the --to date I get more hours even though I have no frames after Dec 22th:

$ watson report --from 2023-12-18 --to 2023-12-23
Mon 18 December 2023 -> Sat 23 December 2023

project1 - 81h 23m 25s
    [sick  6h 09m 00s]

Total: 81h 23m 25s

$ watson report --from 2023-12-18 --to 2023-12-24
Mon 18 December 2023 -> Sun 24 December 2023

project1 - 105h 23m 25s
    [sick  6h 09m 00s]

Total: 105h 23m 25s
Djings commented 2 months ago

Trying to reproduce this bug I noticed, that one easy way of creating this issue is by adding the current frame (-c) argument to report, but not to log. This will result in different times, since a currently running frame might add time depending on --to, but it will not be shown in the watson log cli response.

In an efford to get closer to the issue: Is it possible you have log_current configured to false, but report_current set to true via configuration (since it is obviously not present in the cli commandline).