Skip to content

[feature]: Surface non-critical Custodian errors to UI/API #1942

@ffranr

Description

@ffranr

Problem

Recent changes (285743f, 39405ea) in tapgarden downgraded several critical errors (in inspectWalletTx, receiveProofs, etc.) to logs to prevent daemon crashes. However, this means these errors are now invisible to UI/API clients, potentially leaving users unaware of failed asset transfers or imports.

Analysis

  • Current Behavior: Errors in Custodian.mainEventLoop (specifically during inspectWalletTx, mapProofToEvent, handleMailboxMessages, and receiveProofs) are logged, and the loop continues.
  • Existing Infrastructure:
    • tapgarden has an AssetReceiveEvent which includes an Error field.
    • NewAssetReceiveErrorEvent helper exists.
    • SubscribeReceiveEvents RPC is already capable of mapping this internal error field to the ReceiveEvent protobuf message error field.
  • Gap: The code currently logs the error instead of publishing an AssetReceiveErrorEvent in these specific failure paths.

Proposal

Instrument the Custodian to publish AssetReceiveErrorEvent before logging and continuing in the following areas:

  1. inspectWalletTx: When address.NewTransferFromWalletTx or GetOrCreateEvent fails.
  2. mapProofToEvent: When GetOrCreateEvent fails (currently only logs).
  3. handleMailboxMessages: When processing specific messages fails.

This will utilize the existing SubscribeReceiveEvents RPC stream to notify clients of these failures without requiring protocol changes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions