Skip to content

Prevent stale data in LDAP group sync last owner check

Drew Blessing requested to merge dblessing/gitlab:fix_stale_last_owner into master

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/17764

Customers were reporting that LDAP group sync would occasionally remove the last owner of a group. This didn't seem right (we have tests for this) so I dug in to see what was going on. Previously owners was a memoized method which was the reason for stale data. Now, it's an AR association and the same problem applies. The easiest solution is to reload the model before checking for last owner.

Merge request reports