Skip to content

Resolve todos for current discussion only

Jeff Tucker requested to merge jtucker/resolve-todos-for-discussion into master

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.

  1. In rails console enable the experiment fully
    Feature.enable(:multiple_todos)
  2. Impersonate another user via Admin Area
  3. Go on a commenting spree! Create multiple threads on an issue. Mention your non-impersonated user in each comment. (e.g. @root hello there)
  4. Exit impersonation
  5. Go to Your work > To-Do List
  6. Confirm that you have multiple todos for a single issue
  7. Drill into one of those todos and reply to one of the discussion
  8. Return to Your work > To-Do List
  9. Confirm that todos related to the discussion you commented on were resolved. All other todos on the issue remain open.
Edited by Jeff Tucker

Merge request reports