Restored users get added to groups they already are members of
Currently, after a user is restored (undeleted) the sync attempts to add them to the groups they were already a member of as the group membership checks didn't include them (as they were deleted at the time).
This causes the following error, fortunately, ignored as part of the batch processing:
Error performing request: <HttpError 409 when requesting https://admin.googleapis.com/admin/directory/v1/groups/{group_id}%40{groups_domain}/members?alt=json
returned "Member already exists.". Details: "[{
'message': 'Member already exists.', 'domain': 'global', 'reason': 'duplicate'
}]">
It would be cleaner, if the sync-tool didn't try to add these restored users, assuming their membership is restored too and letting a subsequent run clean up and changes. i.e. remove all uids_to_restore
from members_to_insert
Edited by Robin Goodall