Skip to content

Add missing OutgoingTransactionFailureReason enum values#628

Closed
ls-bolt[bot] wants to merge 1 commit into
mainfrom
06-29-grid-api-add-outgoing-failure-reasons
Closed

Add missing OutgoingTransactionFailureReason enum values#628
ls-bolt[bot] wants to merge 1 commit into
mainfrom
06-29-grid-api-add-outgoing-failure-reasons

Conversation

@ls-bolt

@ls-bolt ls-bolt Bot commented Jun 29, 2026

Copy link
Copy Markdown

This PR has been claimed. The active PR is now #629.

Summary

Adds four missing values to the public OutgoingTransactionFailureReason enum so the Grid API can represent the full set of failure reasons the backend actually emits:

  • EXECUTION_FAILED_POST_DEBIT
  • SETTLEMENT_FAILED
  • TIMEOUT
  • MANUAL_REFUND

Why

sparkcore maps its internal UmaaasSendOperationFailureReason onto this public enum by name (sparkcore/grid/objects/transaction.py::_get_outgoing_transaction_failure_reason). The internal enum has these four members but the public enum didn't, so the mapping threw a (caught) KeyError, logged "Key does not exist in GridOutgoingTransactionFailureReason", and returned None — meaning the API reported an empty failure reason for settlement / timeout / manual-refund / post-debit failures, plus noisy ERROR logs on every render of such a transaction.

Surfaced while debugging the embedded-USDB onramp failures (those failed send-operations carry SETTLEMENT_FAILED).

What changed

  • openapi/components/schemas/transactions/OutgoingTransactionFailureReason.yaml — source enum (the only hand edit)
  • openapi.yaml + mintlify/openapi.yaml — regenerated via make build (redocly bundle)

Notes / decisions

  • LSP_OPERATIONAL_FAILURE intentionally NOT added — sparkcore deliberately maps it to QUOTE_EXECUTION_FAILED (internal-only distinction for LSP-liquidity alerting), so it should never reach the public enum.
  • Alternative considered for EXECUTION_FAILED_POST_DEBIT: it's documented internally as an internal-only distinction (lets the compensation scanner safely credit). I chose to expose it for completeness so the mapping needs no special-case, but it could instead be mapped to QUOTE_EXECUTION_FAILED in sparkcore like LSP_OPERATIONAL_FAILURE. Easy to flip — happy to if you'd prefer to keep it internal.

Follow-up (separate PR, needed for the runtime fix)

This is the canonical spec change. webdev's vendored generated grid-api python package (webdev/grid-api, consumed by sparkcore as a path dep) must be regenerated from this spec via grid-api/update_schema.sh + a packageVersion bump + sparkcore/uv.lock update for sparkcore to actually pick up the new members. That regen needs the Java/Maven/openapi-generator toolchain and is a separate webdev PR — until it lands, sparkcore still KeyErrors.

Test plan

  • make lint-openapi (redocly + spectral, --fail-severity=error) passes — no new findings
  • Bundle is deterministic (clean rebuild produces no diff); change is exactly +4 enum lines across the source component and both bundled outputs

🤖 cryptic-tempest(#1) | Feedback

Add EXECUTION_FAILED_POST_DEBIT, SETTLEMENT_FAILED, TIMEOUT, and MANUAL_REFUND
to the OutgoingTransactionFailureReason enum so the public Grid API can
represent the full set of failure reasons the backend emits. Without them,
sparkcore's mapping from the internal UmaaasSendOperationFailureReason to this
public enum (by name) throws a KeyError and reports an empty failure reason for
settlement/timeout/manual-refund/post-debit failures.
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 29, 2026 4:32pm
grid-wallet-demo Ignored Ignored Preview Jun 29, 2026 4:32pm

Request Review

@ls-bolt ls-bolt Bot added the bolt label Jun 29, 2026

akanter commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants