Resolve todos for current discussion only
What does this MR do and why?
The TodoService
automatically resolves todos when a user comments or reacts with an emoji. Unfortunately it's a bit over-eager when a user interacts with a thread. Rather than clearing the todos for the thread in question, the TodoService
will resolve todos for the entire todoable (issue/mr/whatever).
This MR revises the methods that automatically resolve todos to consider only todos for the current discussion when the user takes action within a discussion. This means that:
- Replying to a discussion will resolve pending todos for that discussion only
- Awarding an emoji to any note within a discussion will resolve pending todos for that discussion only
Fixes #461111 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In rails console enable the experiment fully
Feature.enable(:multiple_todos)
- Impersonate another user via Admin Area
- Go on a commenting spree! Create multiple threads on an issue. Mention your non-impersonated user in each comment. (e.g.
@root hello there
) - Exit impersonation
- Go to Your work > To-Do List
- Confirm that you have multiple todos for a single issue
- Drill into one of those todos and reply to one of the discussion
- Return to Your work > To-Do List
- Confirm that todos related to the discussion you commented on were resolved. All other todos on the issue remain open.