Skip to content

Move timeout to refund reason#303

Merged
shreyav merged 1 commit intomainfrom
03-26-move_timeout_to_refund_reason
Mar 29, 2026
Merged

Move timeout to refund reason#303
shreyav merged 1 commit intomainfrom
03-26-move_timeout_to_refund_reason

Conversation

@shreyav
Copy link
Copy Markdown
Contributor

@shreyav shreyav commented Mar 27, 2026

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

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

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Mar 27, 2026 5:07am

Request Review

Copy link
Copy Markdown
Contributor Author

shreyav commented Mar 27, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

feat: Move timeout to refund reason

openapi

feat: Move timeout to refund reason

python

feat: Move timeout to refund reason

typescript

feat: Move timeout to refund reason
⚠️ grid-openapi studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗

⚠️ grid-python studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ❗build ✅lint ❗test ✅

pip install https://pkg.stainless.com/s/grid-python/bd5ef6db7b2f78cfe0a21a769815ee0ba97f6f6f/grid-0.0.1-py3-none-any.whl
⚠️ grid-typescript studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ❗build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/9ba3d863a71eb8e83291710c57a379a1809ef2a6/dist.tar.gz
⚠️ grid-kotlin studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗build ✅lint ✅test ✅


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-03-29 00:18:23 UTC

@shreyav shreyav force-pushed the 03-26-move_timeout_to_refund_reason branch from f2cef7d to 75dad3b Compare March 27, 2026 05:07
@shreyav shreyav marked this pull request as ready for review March 27, 2026 05:07
@shreyav shreyav requested a review from pengying March 27, 2026 05:07
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR moves TIMEOUT from OutgoingTransactionFailureReason to Refund.reason, changing the semantic meaning: a timeout no longer marks a transaction as FAILED with a failureReason, but instead triggers a refund with reason: TIMEOUT. All schema source files, generated bundles, and the relevant documentation pages are updated consistently.

Key changes:

  • openapi/components/schemas/transactions/OutgoingTransactionFailureReason.yaml — removes TIMEOUT from the failure reason enum
  • openapi/components/schemas/common/Refund.yaml — adds TIMEOUT to the refund reason enum
  • Both openapi.yaml and mintlify/openapi.yaml (generated bundles) are correctly regenerated to reflect the above
  • mintlify/snippets/error-handling.mdx and mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx remove TIMEOUT from failure reason tables

Documentation gap: TIMEOUT is removed from failure reason docs but is not documented anywhere as a refund reason. Developers relying on the docs to understand the timeout behavior will find no guidance after this change. Consider adding a refund reasons section or at minimum a note explaining that timeouts result in a refund.

Confidence Score: 4/5

Safe to merge; schema changes are correct and bundles are properly regenerated. A documentation gap remains but does not affect API behavior.

All schema and bundle changes are correct and consistent. The only issue is a P2 documentation gap where TIMEOUT disappears from the docs without any mention of its new refund-reason role. This doesn't block the API changes but degrades the developer experience until addressed.

mintlify/snippets/error-handling.mdx and mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx — both remove TIMEOUT without documenting it as a refund reason.

Important Files Changed

Filename Overview
openapi/components/schemas/transactions/OutgoingTransactionFailureReason.yaml Removes TIMEOUT from the outgoing transaction failure reason enum — correct source-of-truth change.
openapi/components/schemas/common/Refund.yaml Adds TIMEOUT to the Refund.reason enum — correctly captures the new semantics where a timeout triggers a refund.
openapi.yaml Generated bundle correctly reflects the schema changes from both Refund.yaml and OutgoingTransactionFailureReason.yaml.
mintlify/openapi.yaml Mintlify-specific generated bundle updated in sync with openapi.yaml — no issues.
mintlify/snippets/error-handling.mdx Removes TIMEOUT from outgoing failure reasons but doesn't document it as a refund reason — documentation gap for developers.
mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx Removes TIMEOUT from the failure table without adding any refund-reason documentation; the timeout behavior becomes undocumented for readers of this page.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Outgoing Transaction Created] --> B{Execution Result}
    B -->|Success| C[Status: COMPLETED]
    B -->|Quote expired| D[Status: FAILED\nfailureReason: QUOTE_EXPIRED]
    B -->|Quote execution failed| E[Status: FAILED\nfailureReason: QUOTE_EXECUTION_FAILED]
    B -->|Lightning payment failed| F[Status: FAILED\nfailureReason: LIGHTNING_PAYMENT_FAILED]
    B -->|Funding mismatch| G[Status: FAILED\nfailureReason: FUNDING_AMOUNT_MISMATCH]
    B -->|Counterparty failed| H[Status: FAILED\nfailureReason: COUNTERPARTY_POST_TX_FAILED]
    B -->|Timeout| I[Refund Issued\nRefund.reason: TIMEOUT]
    I --> J[Refund Status: PENDING -> COMPLETED]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: mintlify/snippets/error-handling.mdx
Line: 147

Comment:
**`TIMEOUT` removed but not documented as refund reason**

`TIMEOUT` is correctly removed from the outgoing failure reasons list here, but there's no corresponding mention that a `TIMEOUT` will now result in a refund with `reason: TIMEOUT`. Developers referencing this snippet after the change may not know how to handle the timeout scenario at all.

Since this snippet is shared across multiple sections, consider adding a note (or a dedicated refund-reasons bullet list) indicating that `TIMEOUT` scenarios now surface as a refund:

```mdx
- `TIMEOUT` - Transaction timed out; funds are returned as a refund with `reason: TIMEOUT`
```

or in a separate refund reasons section:

```mdx
### Refund reasons

- `TRANSACTION_FAILED` - Transaction failed after funds were sent
- `USER_CANCELLATION` - Payment cancelled by user
- `TIMEOUT` - Transaction timed out before completion
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx
Line: 272-273

Comment:
**`TIMEOUT` removed without documenting the new refund behavior**

`TIMEOUT` is removed from the failure reasons table, but the page gives no hint that a timeout now results in a refund. A developer reading this page would have no documentation trail explaining what happens when a transaction times out.

Consider adding a brief note in the Failure Handling section, or a new "Refund reasons" table entry:

```mdx
| `TIMEOUT` | Transaction timed out; refund issued automatically | Check refund status |
```

This also applies to `mintlify/snippets/error-handling.mdx` line 147 where the same entry was removed.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Move timeout to refund reason" | Re-trigger Greptile

@@ -145,7 +145,6 @@ When a transaction fails, the `failureReason` field provides specific details:
- `QUOTE_EXPIRED` - Quote expired before execution
- `QUOTE_EXECUTION_FAILED` - Error executing the quote
- `FUNDING_AMOUNT_MISMATCH` - Funding amount doesn't match expected amount
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 TIMEOUT removed but not documented as refund reason

TIMEOUT is correctly removed from the outgoing failure reasons list here, but there's no corresponding mention that a TIMEOUT will now result in a refund with reason: TIMEOUT. Developers referencing this snippet after the change may not know how to handle the timeout scenario at all.

Since this snippet is shared across multiple sections, consider adding a note (or a dedicated refund-reasons bullet list) indicating that TIMEOUT scenarios now surface as a refund:

- `TIMEOUT` - Transaction timed out; funds are returned as a refund with `reason: TIMEOUT`

or in a separate refund reasons section:

### Refund reasons

- `TRANSACTION_FAILED` - Transaction failed after funds were sent
- `USER_CANCELLATION` - Payment cancelled by user
- `TIMEOUT` - Transaction timed out before completion
Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/snippets/error-handling.mdx
Line: 147

Comment:
**`TIMEOUT` removed but not documented as refund reason**

`TIMEOUT` is correctly removed from the outgoing failure reasons list here, but there's no corresponding mention that a `TIMEOUT` will now result in a refund with `reason: TIMEOUT`. Developers referencing this snippet after the change may not know how to handle the timeout scenario at all.

Since this snippet is shared across multiple sections, consider adding a note (or a dedicated refund-reasons bullet list) indicating that `TIMEOUT` scenarios now surface as a refund:

```mdx
- `TIMEOUT` - Transaction timed out; funds are returned as a refund with `reason: TIMEOUT`
```

or in a separate refund reasons section:

```mdx
### Refund reasons

- `TRANSACTION_FAILED` - Transaction failed after funds were sent
- `USER_CANCELLATION` - Payment cancelled by user
- `TIMEOUT` - Transaction timed out before completion
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines 272 to 273
| `QUOTE_EXECUTION_FAILED` | Error executing the quote | Create new quote |
| `INSUFFICIENT_BALANCE` | Source account lacks funds | Fund account, retry |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 TIMEOUT removed without documenting the new refund behavior

TIMEOUT is removed from the failure reasons table, but the page gives no hint that a timeout now results in a refund. A developer reading this page would have no documentation trail explaining what happens when a transaction times out.

Consider adding a brief note in the Failure Handling section, or a new "Refund reasons" table entry:

| `TIMEOUT` | Transaction timed out; refund issued automatically | Check refund status |

This also applies to mintlify/snippets/error-handling.mdx line 147 where the same entry was removed.

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx
Line: 272-273

Comment:
**`TIMEOUT` removed without documenting the new refund behavior**

`TIMEOUT` is removed from the failure reasons table, but the page gives no hint that a timeout now results in a refund. A developer reading this page would have no documentation trail explaining what happens when a transaction times out.

Consider adding a brief note in the Failure Handling section, or a new "Refund reasons" table entry:

```mdx
| `TIMEOUT` | Transaction timed out; refund issued automatically | Check refund status |
```

This also applies to `mintlify/snippets/error-handling.mdx` line 147 where the same entry was removed.

How can I resolve this? If you propose a fix, please make it concise.

@shreyav shreyav merged commit 1670df2 into main Mar 29, 2026
9 checks passed
@shreyav shreyav deleted the 03-26-move_timeout_to_refund_reason branch March 29, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants