Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CmdStart: Fix "make this task pending" note for completed tasks #2769

Merged

Conversation

drehak
Copy link
Contributor

@drehak drehak commented Apr 23, 2022

Description

When trying to start a task that is already completed, the command first tries to modify the task with given arguments as an annotation. That raises a note about making the task pending, even though the task will be set as pending after the command finishes.
The fix preserves the warning for other changes that do not make the completed task pending.

Reproduction of the bug

$ task done 0f57ee11
Completed task 7 'Donald the Done'.
Completed 1 task.
You have more urgent tasks.
$ task start 0f57ee11
Starting task 7 'Donald the Done'.
Started 1 task.
Note: Modified task 0f57ee11 is completed. You may wish to make this task pending with: task 0f57ee11 modify status:pending
You have more urgent tasks.
$ task 0f57ee11

Name          Value                                 
ID            7                                     
Description   Donald the Done                       
Status        Pending                               
Entered       2022-04-23 02:33:34 (29s)
Start         2022-04-23 02:33:58                   
Last modified 2022-04-23 02:33:58 (5s)
Virtual tags  ACTIVE LATEST PENDING READY UNBLOCKED 
UUID          0f57ee11-8771-4bbf-b10f-93dc768c8245
Urgency       4                                     

    active      1 *    4 =      4
                           ------
                                4

Date                Modification                                 
2022-04-23 02:33:51 End set to '2022-04-23 02:33:51'.            
                    Status changed from 'pending' to 'completed'.
2022-04-23 02:33:58 End deleted.
                    Start set to '2022-04-23 02:33:58'.
                    Status changed from 'completed' to 'pending'.

Additional information...

  • Have you run the test suite?

@smemsh
Copy link
Contributor

smemsh commented Apr 25, 2022

I always thought start meant the time work first began, since taskwarrior doesn't keep any history of starts or ends, and there's only one or the other but not both present in the task record. (So, timewarrior should be used for tracking starts/stops).

The task must have been meant to be restartable though, because after done then start, taskwarrior does indeed change status back to pending and replaces end with a current start.

In any case, the warning is indeed spurious, as the task is already pending when you're reminded to do that yourself.

@djmitche
Copy link
Collaborator

djmitche commented Mar 2, 2024

I suspect this is a good fix! Any chance you could rebase and push again, to get the updated statuses to pass?

@djmitche djmitche merged commit 0deeeb0 into GothenburgBitFactory:develop May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants