Skip to content

Resolve "Todo notification count shows notification without having a todo"

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?

What are the relevant issue numbers?

Closes #40871 (closed).

Edited by Sean McGivern

Merge request reports

Loading