Add tests for peer update behavior on peers changes

This commit is contained in:
bcmmbaga
2024-07-31 02:45:09 +03:00
parent eb9aadfd38
commit f0d91bcfc4
2 changed files with 156 additions and 1 deletions

View File

@@ -286,6 +286,7 @@ func (am *DefaultAccountManager) DeletePeer(ctx context.Context, accountID, peer
return err
}
updateAccountPeers := isPeerInActiveGroup(account, peerID)
err = am.deletePeers(ctx, account, []string{peerID}, userID)
if err != nil {
return err
@@ -296,7 +297,7 @@ func (am *DefaultAccountManager) DeletePeer(ctx context.Context, accountID, peer
return err
}
if isPeerInActiveGroup(account, peerID) {
if updateAccountPeers {
am.updateAccountPeers(ctx, account)
}