Fix MySQL no-op update returning account not found in SaveAccountSettings

This commit is contained in:
Viktor Liu
2026-04-08 07:54:14 +02:00
parent fa777684c5
commit 86f1b53bd4

View File

@@ -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
} }