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

Test modification of a task by an on-add hook (test case for #3416) #3443

Merged
merged 3 commits into from May 15, 2024

Conversation

maertsen
Copy link
Contributor

@maertsen maertsen commented May 6, 2024

This PR adds a test case that shows the bug described in #3416. I confirmed it fails on current develop.

I think the bug's root cause is 5bb9857#r141727451.

For a fix:
TBD2::update() as a method was removed in the referenced commit. And it seems calling TBD2::modify() instead will fire on-modify hooks when saving changes by on-add to the database. That's about as far as I got, I hope this contribution will help someone else make progress.

@maertsen
Copy link
Contributor Author

Hmm, the simplest fix is reordering the on-add hook invocation before the save. That fixes the issue while passing the test suite. However, I don't know if it is the behaviour that you want. Anything more complicated is beyond my affinity with C++.

@maertsen maertsen marked this pull request as ready for review May 10, 2024 12:28
@maertsen
Copy link
Contributor Author

On a related note, 3e14d92 is a copy of https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/scripts/hooks/on-add.the with some added comments.

Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took me so long to look at -- good test, good fix!

@djmitche djmitche merged commit fb16dbf into GothenburgBitFactory:develop May 15, 2024
12 checks passed
djmitche added a commit to djmitche/taskwarrior that referenced this pull request May 15, 2024
This test existed, but didn't notice that the task was actually added.
The bug itself was fixed in GothenburgBitFactory#3443.
@djmitche
Copy link
Collaborator

This also fixes #3455! Can you take a look at #3457 for me before I merge it?

djmitche added a commit that referenced this pull request May 15, 2024
This test existed, but didn't notice that the task was actually added.
The bug itself was fixed in #3443.
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

2 participants