GothenburgBitFactory / taskwarrior

Taskwarrior - Command line Task Management
https://taskwarrior.org
MIT License
4.01k stars 277 forks source link

[TW-1953] Recurring tasks spawned incorrectly #1963

Open taskwarrior opened 6 years ago

taskwarrior commented 6 years ago

Jan Stolarek on 2018-02-03T17:25:04Z says:

I have a bunch of tasks that I want to recur on a monthly basis. On the 2nd December I created two such tasks:

`$ task add "Create backup" recur:1month due:3d Created task 13 (recurrence template).

$ task add "Pay the bills" recur:1month due:3d Created task 13 (recurrence template).`

Now on the 3rd December I completed one of them:

3nd December:

$ task 16 done Completed task 16 'Create backup'. Completed 1 task.

On the 6th December new instances of each task have been spawned:

`$ task

ID P Due Time Description 17 M 5-12-2017 22h Pay the bills 19 M 4-01-2018 Create backup 20 M 4-01-2018 Pay the bills`

There is now one instance of "Create backup" and two instances of "Pay the bills". New instances will be due in a month so I put them on a waiting list:

`$ task 19-20 mod wait:eom

Modifying task 19 'Create backup'. Modifying task 20 'Pay the bills'. Modifying recurring task 17 'Pay the bills'. Warning: You have specified that the 'wait' date is after the 'due' date.`

At some point I also mark task 17 as done. I admit I have not precisely reporduced my every usage of task during the month of December but on the 6th of January I realized I have the following waiting tasks:

`$ task waiting

ID P Project Wait Remaining Due Description 14 M 30-01-2018 3w 30-01-2018 Create backup 15 M 30-01-2018 3w 30-01-2018 Pay the bills 25 M 1-03-2018 7w 3-02-2018 Create backup 27 M 1-03-2018 7w 3-02-2018 Pay the bills`

Notice two bogus instances with wait times set to March and due dates for February. I have marked those two tasks as done on 31st January and also marked tasks 14 and 15 as done. On the 31st January I already had new instances of my recurring tasks spawned:

`$ task waiting

ID P Project Wait Remaining Due Description 14 M 28-02-2018 3w 28-02-2018 Create backup 15 M 28-02-2018 3w 28-02-2018 Pay the bills`

On the 3rd another instances were spawned:

`$ task waiting

ID P Project Wait Remaining Due Description 14 M 28-02-2018 3w 28-02-2018 Create backup 15 M 28-02-2018 3w 28-02-2018 Pay the bills 25 M 1-04-2018 3w 5-03-2018 Create backup 26 M 1-04-2018 3w 5-03-2018 Pay the bills`

Notice the nonsense wait and due dates for new tasks.

This problem did not happen with older versions of Taskwarrior. I don't remember whether this started happening when I switched from 1.9 to 2.0 or from 2.0 to 2.5, but the fact is that something goes wrong with spawning recurring tasks and every few months I just have to delete all of them and create them anew because they become such a mess. Ot seems like there are two copies of the same task being spawned and something bad is happening with "due" dates ("wait" dates as well?). Sorry, I know this is a bit vague but this is the best description I can provide for the moment.

taskwarrior commented 6 years ago

Migrated metadata:

Created: 2018-02-03T17:25:04Z
Modified: 2018-02-03T17:25:04Z
jstolarek commented 6 years ago

I just noticed something that might explain the source of the bug. It seems that new recurring tasks are spawned both from the recurence templates AND from currently existing instances of recurring tasks. Here's why. As usual, I had my recurring tasks spawned a few days ago:

$ task

ID P Project Due        Time Description
10 M         28-03-2018      Create backup
11 M         28-03-2018      Pay the bills

There were no waiting instances of recurring tasks in the waiting lists at this points. I have paid the bills, but since I am lazy I didn't do my backups, so the task went overdue:

$ task

ID P Project Due        Time Description
10 M   m     28-03-2018   3d Create backup

But when I checked the waiting list today I realized that two copies of "Create backup" task have been spawned but only one copy of "Pay the bills":

$ task waiting

ID P Project Wait       Remaining Due        Description
16 M         28-04-2018        3w 28-04-2018 Create backup
19 M         28-04-2018        3w 28-04-2018 Pay the bills
20 M         28-04-2018        3w 28-04-2018 Create backup

So it seems that one additional "Create backup" task was spawned from the not yet finished instance for this month. This is clearly wrong - tasks should be spawned only from templates.

devurandom commented 5 years ago

Is this a duplicate of #1649 (which itself is a mirror of GothenburgBitFactory/taskserver#46)?

jstolarek commented 5 years ago

I'm not sure. Other similar bug reports seem to involve syncing. I am only using a local client and not syncing with any remote server.

rudolfschmidt commented 4 years ago

I get the same problem. It has nothing to do with sync. Forget that completely.

madduck commented 4 years ago

I get the same problem. It has nothing to do with sync. Forget that completely.

I think it has everything to do with sync, or can you confirm that it happens to you in a single-system setup without sync?

rudolfschmidt commented 4 years ago

Exactly that is what I mentioned

jstolarek commented 4 years ago

I think it has everything to do with sync

Not in my setup - I don't use syncing.

madduck commented 4 years ago

Alright, I rest my case then. Sorry, @rudolfschmidt, but it was not clear from your message whether you were not using sync, or simply of the opinion that it has nothing to do with it.

rudolfschmidt commented 4 years ago

no worries, everything ok!