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

task 2 start does not synchronize with timewarrior properly when other task already active #60

Open
user202729 opened this issue Dec 22, 2024 · 7 comments

Comments

@user202729
Copy link

To reproduce:

  • install taskwarrior and timewarrior, as well as the hook.
  • create 2 tasks with let's say id 1 and 2.
  • type task 1 start → task 1 is started
  • type task 2 start → according to timewarrior task 1 is stopped and task 2 is started, while according to taskwarrior both tasks are currently active.
  • type task 1 start → taskwarrior reports it is already started

Desired behavior: taskwarrior automatically task 1 stop when task 2 start is executed in the situation above.

@djmitche
Copy link

Should this be moved to the timewarrior repo, or is there something to suggest this bug is in taskwarrior?

@user202729
Copy link
Author

Honestly I don't know about the internal design yet to decide how the modification is best made.

One way I can think of is to make the timewarrior to tell taskwarrior to stop all other tasks when task X start command is issued, but I'm not sure if this can be implemented in a hook.

On the other hand if the purpose is not specifically to track time spent, then it also makes sense to have multiple tasks active at the same time (i.e. having multiple task X start).

@djmitche
Copy link

Those sound like considerations for timewarrior, so I'll move this across.

@djmitche
Copy link

Oh, lol, I can't -- @lauft maybe you can?

@lauft
Copy link
Member

lauft commented Dec 27, 2024

I am transferring this to the task-timewarrior-hook repository.

@lauft lauft transferred this issue from GothenburgBitFactory/taskwarrior Dec 27, 2024
@lauft
Copy link
Member

lauft commented Dec 28, 2024

Timewarrior or the task-timewarrior hook do not have a back channel to Taskwarrior. If there was one, how could they know to stop task 1? One could stop all tasks except 2... Is there a Taskwarrior hook to do this?

The connection between a task and the tracked time is done by tagging the respective intervals according to the tasks description, project, and tags. With the current behavior of the hook each such interval is associated with only one task. One could change that to tracking both tasks by creating an interval with the tags from both tasks when starting task 2, but that could come with some other side effects. Using the task's UUID might be a solution for this, but using those as tag is a bit ugly, so it would require to extend the storage model.

@user202729
Copy link
Author

I think one way is to have an option (disabled by default, but if you also use timewarrior then it suggests you to enable it) in taskwarrior settings that when you do task A start then you stop all other tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants