timewarrior icon indicating copy to clipboard operation
timewarrior copied to clipboard

Problem deleting overlapping intervals caused after starting tracking with :adjust hint

Open optik-aper opened this issue 6 years ago • 2 comments

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.

optik-aper avatar Nov 14 '18 15:11 optik-aper

I should mention another thing. When I try to stop the open interval or I try to start a new interval I get You cannot overlap intervals. Correct the start/end time, or specify the :adjust hint.

optik-aper avatar Nov 14 '18 15:11 optik-aper

Sorry about that previous commit. I had the wrong issue number on it accidentally. (I had a branch where I wanted to see if I could recreate this issue, but was unable to, with the 1.1.1 release at least).

sruffell avatar Nov 16 '18 14:11 sruffell