Assigning already assigned user through quick action fails

Summary

When a user is already assigned to an issue or an MR, and you try to assign this user through a quick action, the comment submission fails with a 500 error.

Steps to reproduce

  1. Create an issue
  2. Assign a user, e.g. @toupeira
  3. Post a comment with /assign @toupeira

What is the current bug behavior?

The comment submission fails.

If the comment is part of an MR review draft, the whole publishing process fails midway (this might warrant ~S2?)

What is the expected correct behavior?

The comment should be posted, and the quick action should be ignored.

Relevant logs and/or screenshots

Frontend shows an error:

image

Backend raises a ActiveRecord::RecordNotUnique exception: https://sentry.gitlab.net/gitlab/gitlabcom/issues/974515/

Output of checks

This bug happens on GitLab.com

Possible fixes

Assignee Loading
Time tracking Loading