Skip to content

Fix error when duplicate users are merged in approvers list

Stan Hu requested to merge sh-fix-dupe-approvals-failing into master

If a user who belongs to an approval group and also is an individual in the approval rule, MergeService will fail in the after_merge, which will cause MergeWorker to retry again. Since the merge has been successfully merged, MergeWorker will encounter an error since MergeService is not idempotent.

This change fixes the issue by using the Array |= join method to add an element to the Array, unless it is already present. This fixes the immediate bug, but we will have to address the idempotency issues later.

Closes #13488 (closed)

Edited by Stan Hu

Merge request reports