GothenburgBitFactory / GothenburgBitFactory/timewarrior

Adding work with track during active tracking with exclusions

Open
#490 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.7k
Forks
117
Avg merge
1d 7h
Merged PRs (30d)
5

Description

I needed to add some past evening work with the track command in the middle of an ongoing task that was limited with exclusions.

This is what happened.
```
define exclusions:
monday = <6:30 12:00-12:30 >15:00
tuesday = <6:30 12:00-12:30 >15:00
wednesday = <6:30 12:00-12:30 >15:00
thursday = <6:30 12:00-12:30 >15:00
friday = <6:30 12:00-12:30 >15:00
saturday = >0:00
sunday = >0:00

❯ timew s :week

Wk Date Day Tags Start End Time Total
W17 2022-04-25 Mon Things 6:30:00 12:00:00 5:30:00
Things 12:30:00 15:00:00 2:30:00 8:00:00
W17 2022-04-26 Tue Things 6:30:00 12:00:00 5:30:00
Things 12:30:00 15:00:00 2:30:00 8:00:00
W17 2022-04-27 Wed Things 6:30:00 12:00:00 5:30:00
Things 12:30:00 15:00:00 2:30:00 8:00:00
W17 2022-04-28 Thu Things 6:30:00 - 0:57:23 0:57:23

24:57:23

> timew track 2022-04-27T19:00 - 2022-04-27T23:00 "Other thing"

❯ timew s :week

Wk Date Day Tags Start End Time Total
W17 2022-04-25 Mon Thing 6:30:00 - 17:30:00 17:30:00
W17 2022-04-26 Tue Thing 0:00:00 - 24:00:00 24:00:00
W17 2022-04-27 Wed Thing 0:00:00 - 24:00:00
Other thing 19:00:00 23:00:00 4:00:00 28:00:00
W17 2022-04-28 Thu Thing 0:00:00 - 7:27:59 7:27:59

76:57:59
```

I would expect the result to be like this.
```
Wk Date Day Tags Start End Time Total
W17 2022-04-25 Mon Things 6:30:00 12:00:00 5:30:00
Things 12:30:00 15:00:00 2:30:00 8:00:00
W17 2022-04-26 Tue Things 6:30:00 12:00:00 5:30:00
Things 12:30:00 15:00:00 2:30:00 8:00:00
W17 2022-04-27 Wed Things 6:30:00 12:00:00 5:30:00
Things 12:30:00 15:00:00 2:30:00 8:00:00
Other thing 19:00:00 23:00:00 4:00:00 28:00:00
W17 2022-04-28 Thu Things 6:30:00 - 0:57:23 0:57:23

24:57:23
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the shown exclusions, `timew track` command, and `timew s :week` reports. Trace the track command's handling of an interval added during active tracking and compare the resulting report with the expected output. Done means adding past work preserves existing tracked intervals and exclusion boundaries without inflating other days' totals.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.