-
Notifications
You must be signed in to change notification settings - Fork 0
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 undo' errors out #4
Comments
Can't reproduce. What version of TaskWarrior are you using? |
I am on 2.6.2:
|
Should have asked this earlier, I'll need the Python version that's running the hook script. There can be multiple versions of Python installed, by default the hook script uses the path returned by the shebang line: #!/usr/bin/env python |
Yeah, my bad. I should have included that as well:
|
Apply this patch to the on-modify hook script: --- a/manage_notes_annotation.py
+++ b/manage_notes_annotation.py
@@ -124,5 +124,7 @@ if __name__ == '__main__':
except:
exit_error()
+ with open('/tmp/onenote.log', 'w') as f:
+ f.write(json.dumps(modified_task))
print(json.dumps(modified_task))
sys.exit(0) Then |
Can't reproduce:
|
No joy:
Tried on fully up-to-date Arch and Ubuntu 20.04.4 box, with same results. And add your patch. |
Still cannot reproduce:
At this point I'm forced to conclude it's an issue in your environment, so I'm going to leave it to you and close this issue. If you do come across a specific fix, please feel free to reopen. |
The issue is not undo a note, but undoing the task vs deleting the issue. |
Not really sure what you mean, the note is a UDA on the task, it's part of the task data, so rolling that back is undoing an edit to the task. |
Maybe it would be better to show you. I can create an task, run onenote, undo the onenote note, but then when I try to undo again to remove the note, it errors. This error happens even if I do not add a note:
Hope that explains it. |
I was not able to reproduce this bug before because I was not clear on the use case, it never even occurred to me to remove a task by undoing it, so I was only checking the modify case. I've now been able to reproduce this bug. |
Works now! Many thanks for putting up with me. |
Good to hear. Curious, since you're using TaskWarrior 2.6.2, how are you working around #3 ? |
Simple hack:
|
Yeah. I've been hesitant to put a fix into Onenote because I suspect any fix in TaskWarrior will re-break things. I'll see if I can move that TaskWarrior bug along... |
Which is why I put it in my local copy and did not submit a PR. It is working for me, so I am good. Thanks a again for this software and helping me fix my use case. |
Would you be willing to post your patch to #3 so that others may find and benefit from it? |
Done. |
So, I screw up from time to time, and want to remove a task I have just added, so I use the
task undo
function, however, this does not work well with the hook for onenote:Everything else is working fine for me. I know I could just delete the task, but I sometimes do not want any record of the mistake.
Thanks!
The text was updated successfully, but these errors were encountered: