Context
payInvoice in src/services/ibex/client.ts calls the generated SDK through Ibex.authentication.withAuth(() => Ibex.ibex.payInvoiceV2(...)) instead of the standard Ibex.payInvoiceV2(...) wrapper. That seam existed because ibex-client@3.2.0's ApiError discarded the response body (lnflash/ibex-client#6), which made "insufficient balance" 400s unclassifiable through the standard path.
As of ibex-client@3.3.0 (bumped in #477), ApiError extracts httpCode / ibexResponse / ibexMessage itself, and #477's integration tests prove errorHandler classifies a body-carrying ApiError through the standard path. The seam is now redundant and retained only as belt-and-braces.
Task
Restore the standard call:
return Ibex.payInvoiceV2(bodyWithHooks).then(errorHandler)
and remove the httpErrorHandler catch from this path (keeping httpErrorHandler itself as defense-in-depth for any remaining raw-fetch callers, or removing it if none remain). Collapsing a payment path deserves its own PR with its own test scrutiny — that's why it was not folded into the #477 deps bump.
Acceptance
payInvoice uses Ibex.payInvoiceV2(bodyWithHooks).then(errorHandler)
- Insufficient-balance 400s still classify as
InsufficientIbexBalance (existing unit tests in test/flash/unit/services/ibex/errors.spec.ts must keep passing; add a payInvoice-level test if feasible)
- Unrecognized IBEX 400s still log the IBEX body detail exactly once
Context
payInvoiceinsrc/services/ibex/client.tscalls the generated SDK throughIbex.authentication.withAuth(() => Ibex.ibex.payInvoiceV2(...))instead of the standardIbex.payInvoiceV2(...)wrapper. That seam existed because ibex-client@3.2.0'sApiErrordiscarded the response body (lnflash/ibex-client#6), which made "insufficient balance" 400s unclassifiable through the standard path.As of ibex-client@3.3.0 (bumped in #477),
ApiErrorextractshttpCode/ibexResponse/ibexMessageitself, and #477's integration tests proveerrorHandlerclassifies a body-carryingApiErrorthrough the standard path. The seam is now redundant and retained only as belt-and-braces.Task
Restore the standard call:
and remove the
httpErrorHandlercatch from this path (keepinghttpErrorHandleritself as defense-in-depth for any remaining raw-fetch callers, or removing it if none remain). Collapsing a payment path deserves its own PR with its own test scrutiny — that's why it was not folded into the #477 deps bump.Acceptance
payInvoiceusesIbex.payInvoiceV2(bodyWithHooks).then(errorHandler)InsufficientIbexBalance(existing unit tests intest/flash/unit/services/ibex/errors.spec.tsmust keep passing; add a payInvoice-level test if feasible)