Closed dkasak closed 1 year ago
Modifying the task to add a baz
tag shows the hook being called two times, once with a list and once with a comma-separated string:
✦ ❯ task 118 modify +baz
Modifying task 118 'Test task'.
Modified 1 task.
Removed Test task bar foo from @1
Note: '"Test task"' is a new tag.
Note: 'z' is a new tag.
Added Test task b a z , f o o , b a r to @1
{'description': 'Test task', 'entry': '20230426T014808Z', 'modified': '20230426T014840Z', 'size': 'small', 'start': '20230426T014840Z', 'status': 'pending', 'uuid': 'fb3270e0-06a5-4b3a-b272-59b2a1f32554', 'tags': ['bar', 'foo']}
{'description': 'Test task', 'entry': '20230426T014808Z', 'modified': '20230426T014840Z', 'size': 'small', 'start': '20230426T014840Z', 'status': 'pending', 'uuid': 'fb3270e0-06a5-4b3a-b272-59b2a1f32554', 'tags': 'baz,foo,bar'}
Presumably this could also be seen as a taskwarrior bug?
@dkasak Just a side note: The on-modify.timewarrior
hook has its own repository 👉🏻 https://github.com/GothenburgBitFactory/task-timewarrior-hook.
The issue will be transferred to there.
Presumably this could also be seen as a taskwarrior bug?
As far as I can see, the hooks expects tags
to be an array of strings. So, if this is not the case, I agree that this looks like Taskwarrior doing something odd. Can you open an issue there?
@dkasak If you use taskpirate or anything related to tasklib, take a look into this issue
@Smith4545 Thank you for that reference. It's indeed what's causing my problem :( Which I think means we can close this issue.
The
on-modify.timewarrior
hook creates spurious tags:Note the tags
a
,b
,f
,o
,r
.This appears to happen because the JSON object passed to the hook sometimes contains a list for the
tags
, but other times it's a comma-separated list. Placing someprint
calls shows the hook sees this for the above task: