Work item checklist items change state unexpectedly

Summary

In some cases checklist items in a work item (epic, task) get unchecked when not directly changed. Originally raised on Slack

Steps to reproduce

  1. Add a bunch of checklist items to description.
  2. Mark items as checked, notice if system notes for checked items show up.
  3. Edit description to add some content (leaving original checklist as it is).
  4. Save the description and check items are not unchecked, and even the system notes show up of them getting unchecked by description author.

Example Project

gitlab-com/marketing&5298

What is the current bug behavior?

Checklist items change state without being directly changed

What is the expected correct behavior?

Checklist items only change state when users check or uncheck them directly

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:env:info\`) (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`)

(For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Nick Leonard