Changing expiry date of a member in a group/project results in a duplicate API call being made to update the member attributes

Summary

Changing expiry date of a member in a group/project results in a duplicate API call being made to update the member attributes

Steps to reproduce

  1. Go to the members page of a group or of a project.
  2. For an existing member in the group/project, try changing the expiry date of the member.

Example Project

What is the current bug behavior?

Two requests are fired consecutively to the same endpoint for this single change. This can be noticed in the Network tab in the browser.

What is the expected correct behavior?

This should only fire a single request ideally.

Relevant logs and/or screenshots

The first request is a POST request with access_level and expires_at, and the second is PATCH with just :access_level as param. The latter seems unnecessary for a change in expiry.

The endpoint (in case of group members) is: groups/:group_name/-/group_members/:member_id

Side effects.

Because 2 calls are being made to this endpoint, 2 updates are processed in the backend for the same member and this leads to 2 audit event records being created for a single action performed by the user.

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Results of GitLab application Check

Possible fixes

Edited by Manoj M J