mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-19 16:56:39 +00:00
Fix MySQL no-op update returning account not found in SaveAccountSettings
This commit is contained in:
@@ -4077,9 +4077,10 @@ func (s *SqlStore) SaveAccountSettings(ctx context.Context, accountID string, se
|
|||||||
return status.Errorf(status.Internal, "failed to save account settings to store")
|
return status.Errorf(status.Internal, "failed to save account settings to store")
|
||||||
}
|
}
|
||||||
|
|
||||||
if result.RowsAffected == 0 {
|
// MySQL reports RowsAffected=0 for no-op updates where values don't change,
|
||||||
return status.NewAccountNotFoundError(accountID)
|
// unlike SQLite/Postgres which report matched rows. Skip the check since the
|
||||||
}
|
// caller (UpdateAccountSettings) already verified the account exists via
|
||||||
|
// GetAccountSettings with LockingStrengthUpdate.
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user