Skip to content

deleteChannelAccounts silently ignores RPC errors #536

@aristidesstaffieri

Description

@aristidesstaffieri

What version are you using?

latest

Problem

File: internal/services/channel_account_service.go lines 184-196

Buggy code:

_, err = s.RPCService.GetAccountLedgerSequence(chAcc.PublicKey)
if errors.Is(err, ErrAccountNotFound) {
    log.Ctx(ctx).Infof("... proceeding to delete it from the database")
    continue
}
// BUG: if err != nil && !ErrAccountNotFound, error is silently dropped
ops = append(ops, &txnbuild.AccountMerge{...})

Description: When GetAccountLedgerSequence returns a non-ErrAccountNotFound error (network timeout, RPC unavailable), the error is silently dropped and an AccountMerge operation is added. Additionally, when ALL accounts are not on chain, ops is empty, the if len(ops) > 0 block is skipped, and no accounts are deleted from the DB despite the log message saying they will be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions