Resolve "Todo notification count shows notification without having a todo"
requested to merge 40871-todo-notification-count-shows-notification-without-having-a-todo into master
What does this MR do?
Ensures that the todo counter cache is reset for users with todos on the target when the target is deleted.
Are there points in the code the reviewer needs to double check?
The interface to TodoService#destroy_target
is a little weird, but I couldn't think of a better solution. We need to gather the users before destroying the target, but update the caches afterwards. I guess the other options is to use run_after_commit
, but I'm not sure if adding more AR hooks is a good idea.
Why was this MR needed?
If you had a todo and the target was deleted, the counter would be wrong.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug - Review
-
Has been reviewed by Backend
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered
What are the relevant issue numbers?
Closes #40871 (closed).
Edited by Sean McGivern