Skip to content

[management] Remove deleted user peers from groups on user deletion #4121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2025

Conversation

bcmmbaga
Copy link
Contributor

@bcmmbaga bcmmbaga commented Jul 8, 2025

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@bcmmbaga bcmmbaga marked this pull request as ready for review July 8, 2025 16:52
@Copilot Copilot AI review requested due to automatic review settings July 8, 2025 16:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors peer deletion to centralize group cleanup logic, ensuring deleted peers are consistently removed from all groups in one place.

  • Removed redundant group removal code from DefaultAccountManager.DeletePeer
  • Added group removal logic inside deletePeers to handle both single and multiple peer deletions
Comments suppressed due to low confidence (1)

management/server/peer.go:1508

  • Add unit or integration tests to verify that deletePeers correctly removes peers from all associated groups, covering both single-peer and multi-peer deletion scenarios.
		groups, err := transaction.GetPeerGroups(ctx, store.LockingStrengthUpdate, accountID, peer.ID)

Copy link

sonarqubecloud bot commented Jul 8, 2025

@bcmmbaga bcmmbaga merged commit 969f1ed into main Jul 9, 2025
66 of 69 checks passed
@bcmmbaga bcmmbaga deleted the fix/delete-user-peer-cleanup branch July 9, 2025 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants