GothenburgBitFactory / GothenburgBitFactory/timewarrior
Problem deleting overlapping intervals caused after starting tracking with :adjust hint
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 117
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
I've had this happen once before and ultimate had to resort to a backup of the database. I wasn't sure how it happened then and I don't think it was because of the `:adjust` hint, since I only recently started using that. I have the full command history this time and I noticed it right away.
Ran summary:
```
Wk Date Day ID Tags Start End Time Total
W46 2018-11-14 Wed @4 Morning catch-up 7:24:02 7:54:48 0:30:46
@3 Setting up bugwarrior 7:54:48 8:48:03 0:53:15
@2 Morning catch-up 8:48:03 9:28:52 0:40:49
@1 Fix staff/faculty records for [redacted] supp 9:28:52 - 0:50:32 2:55:22
2:55:22
```
Realized I wasn't tracking the correct task and tried to correct:
```
timew start "Email catch-up" 40mins ago
You cannot overlap intervals. Correct the start/end time, or specify the :adjust hint.
```
As far as I can tell, I wasn't overlapping. The current tracking had been running for 50 minutes and I was trying to start new tracking `40mins ago`. So I decided to try the `:adjust` hint:
```
timew start "Email catch-up" 40mins ago :adjust 255 ↵
Recorded "Fix staff/faculty records for [redacted]" [redacted] supp
Started 2018-11-14T09:28:52
Ended 39:58
Total 1:42:12
Tracking "Email catch-up"
Started 2018-11-14T09:39:58
Current 10:19:59
Total 0:40:01
```
But right away I knew something was messed up when I ran the summary:
```
Wk Date Day ID Tags Start End Time Total
W46 2018-11-14 Wed @8 Morning catch-up 7:24:02 7:54:48 0:30:46
@7 Setting up bugwarrior 7:54:48 8:48:03 0:53:15
@6 Morning catch-up 8:48:03 9:28:52 0:40:49
@5 Fix staff/faculty records for [redacted] supp 9:28:52 - 0:51:10
@4 Fix staff/faculty records for [redacted] supp 9:28:52 9:39:58 0:11:06
@3 Fix staff/faculty records for [redacted] supp 9:28:52 9:39:58 0:11:06
@2 Email catch-up 9:39:58 - 0:40:04
@1 Fix staff/faculty records for [redacted] supp 9:39:58 9:39:58 0:00:00 3:58:16
3:58:16
```
So I deleted all the noise, including the tracking I initially wanted to capture but I'm unable to delete the duplicate open interval `@2`. I've issued `timew delete @2` multiple times it outputs `Deleted @2` but when I run the summary, it's still there:
```
Wk Date Day ID Tags Start End Time Total
W46 2018-11-14 Wed @5 Morning catch-up 7:24:02 7:54:48 0:30:46
@4 Setting up bugwarrior 7:54:48 8:48:03 0:53:15
@3 Morning catch-up 8:48:03 9:28:52 0:40:49
@2 Fix staff/faculty records for [redacted] supp 9:28:52 - 0:53:38
@1 Fix staff/faculty records for [redacted] supp 9:28:52 10:20:31 0:51:39 3:50:07
3:50:07
```
It might also be worth noting that the interval that's duplicated and is not able to be deleted was initally created through the Taskwarrior hook. I completed the task and marked it as done in Taskwarrior which normally will close the Timewarrior tracking on that item. I didn't check right away if it did but it appears that it did not since the tracking was still open when I checked 40 minutes later.
Contributor guide
Research direction
Start by reproducing the reported sequence of `timew start` with `:adjust`, followed by summary and repeated `timew delete`, using the command history in the issue. Trace the `:adjust` handling, interval deletion, and the Taskwarrior hook entry point. Done means overlapping or duplicate open intervals are not created, and an interval reported as deleted no longer appears in summary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100