Replies: 1 comment 2 replies
-
Maybe Looking at the code, indeed
whereas modify case notes:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Context
I have
taskwarrior
2.6.2, andtasklib
2.5.1-2 installed withpacman
. I also have many hooks modifying or checking the validity of the added or modified task, they all work fine.Since I am trying to implement some feature loosely resembling sub tasks, I need to 'cascade' changes made to "parent tasks" onto "children tasks".
Problem
I tried to reduce everything to the minimum to understand the errors I was getting, it turns out what works with
on-add
hooks do not inon-modify
hooks. I cannot find any mention of that as a limitation in the docs. Maybe I missed something, in which case, sorry about that.Question
Can I modify tasks in the taskwarrior database from
on-modify
hooks ? And, if yes, how ?Steps to reproduce
Everything below is done with a 'minimal' config generated by
taskwarrior
, and no other hooks in place than the one being tested.on-add Hook
Works as expected:
on-modify hook
Same hook as above expecting the same results:
No error is thrown, but no effects on the database:
Additional observations
Modifying the
on-modify
hook so the initial command filtering does not return any matching tasks throws an error.Other attempts
Loop
Looping through tasks using
tasklib
produces exactly the same results astw.execute_command
. It also works fine from anon-add
hook.subprocess produces interesting results
Trying to run the
task
command using the pythonsubprocess
module produces a taskwarrior as if it was modifying the tasks, but produces no effects on the database from anon-modify
hook. Again, it works as expected from anon-add
hook.Output from the
on-modify
hook:Beta Was this translation helpful? Give feedback.
All reactions