Skip to content

fix: Remove avatar and credentials only after user removal - #65435

Merged
SystemKeeper merged 1 commit into
masterfrom
fix/noid/cleanup-only-on-successful-delete
Oct 26, 2026
Merged

SystemKeeper merged 1 commit into
masterfrom
fix/noid/cleanup-only-on-successful-delete

Conversation

@SystemKeeper

@SystemKeeper SystemKeeper commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When deleting a user, we already call $avatarManager->deleteUserAvatar($this->uid);, which removes the avatars after the user was deleted. Additionally we had a before listener, which removed the avatars before a user was actually deleted. This (alongside the removal of credentials) is tricky when the userbackend denies the user deletion (e.g. LDAP with an active user).

How to test:

  • Have a LDAP user with a custom avatar
  • Run occ user:delete <ldap-user>
  • See The specified user could not be deleted. Please check the logs.
  • Check the avatar of the user -> it is gone.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@SystemKeeper SystemKeeper added this to the Nextcloud 36 milestone Oct 12, 2026
@SystemKeeper SystemKeeper self-assigned this Oct 12, 2026
@SystemKeeper SystemKeeper added bug 3. to review Waiting for reviews feature: users and groups php Pull requests that update Php code labels Oct 12, 2026
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@SystemKeeper
SystemKeeper force-pushed the fix/noid/cleanup-only-on-successful-delete branch from 9e4a1e9 to fe1be72 Compare October 15, 2026 13:53
@SystemKeeper
SystemKeeper marked this pull request as ready for review October 18, 2026 12:49
@SystemKeeper
SystemKeeper requested a review from a team as a code owner October 18, 2026 12:49
@SystemKeeper
SystemKeeper requested review from Altahrim, CarlSchwan, leftybournes and salmart-dev and removed request for a team October 18, 2026 12:49
@SystemKeeper

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@SystemKeeper

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@SystemKeeper
SystemKeeper merged commit 8e60785 into master Oct 26, 2026
185 checks passed
@SystemKeeper
SystemKeeper deleted the fix/noid/cleanup-only-on-successful-delete branch October 26, 2026 18:57
@backportbot

backportbot Bot commented Oct 26, 2026

Copy link
Copy Markdown

The backport to stable34 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable34
git pull origin stable34

# Create the new backport branch
git checkout -b backport/65435/stable34

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick fe1be727

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/65435/stable34

Error: Failed to check for changes with origin/stable34: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for more than 7 days. As we do not monitor merged or closed pull requests, we are locking this pull request to prevent further comments from getting lost in the noise.
If you discovered any issues with this pull request, please open a new issue instead. In case you want to discuss this pull request or have further questions, please use our forum: https://help.nextcloud.com

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants