fix(flash): cap IBEX receive invoice expiration at 60s (ENG-427)#410
Merged
islandbitcoin merged 1 commit intoJun 19, 2026
Conversation
Flash uses non-msat IBEX currency accounts (USD/USDT/JMD) for its receive flows, which IBEX limits to a 60s BOLT11 expiry; only msat accounts allow up to 900s. The backend defaulted to 5 minutes (300s) and IBEX silently capped that down to 60s, so the requested value was never honored. - Add a documented IBEX_RECEIVE_MAX_EXPIRATION_SECONDS (60s) constant next to the expiry policy, recording the IBEX account-type limit. - Clamp every IBEX receive invoice centrally in the Ibex client's addInvoice wrapper via cappedIbexReceiveExpiration, so no caller can request more. - Default the USD receive flows to 60s instead of 300s. - Cover the policy with unit tests, including a regression guard that a 5-minute (300s) request can never reach IBEX. The mobile receive countdown already decodes the actual BOLT11 expiry, so no client change is required. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bobodread876
approved these changes
Jun 18, 2026
Contributor
Author
|
Merging. ✅ Final pre-merge check: approved, mergeable, and the relevant CI gates pass — Unit test (the new policy tests run green), check-secret, Check Schema, GraphQL Inspector, and CodeQL. The red checks (
Cleanup pass also confirmed no orphaned |
heyolaniran
pushed a commit
to heyolaniran/flash
that referenced
this pull request
Jun 20, 2026
…lash#410) Flash uses non-msat IBEX currency accounts (USD/USDT/JMD) for its receive flows, which IBEX limits to a 60s BOLT11 expiry; only msat accounts allow up to 900s. The backend defaulted to 5 minutes (300s) and IBEX silently capped that down to 60s, so the requested value was never honored. - Add a documented IBEX_RECEIVE_MAX_EXPIRATION_SECONDS (60s) constant next to the expiry policy, recording the IBEX account-type limit. - Clamp every IBEX receive invoice centrally in the Ibex client's addInvoice wrapper via cappedIbexReceiveExpiration, so no caller can request more. - Default the USD receive flows to 60s instead of 300s. - Cover the policy with unit tests, including a regression guard that a 5-minute (300s) request can never reach IBEX. The mobile receive countdown already decodes the actual BOLT11 expiry, so no client change is required. Co-authored-by: Dread <bobodread@bobodread.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Flash uses non-msat IBEX currency accounts (USD/USDT/JMD) for its receive flows. IBEX caps BOLT11 receive-invoice expiry by account type — 60s for these accounts, 900s only for msat accounts. The backend defaulted to 5 minutes (300s) and sent
expiration: 300to IBEX, which silently capped it to 60s. So the requested value was never honored, and the mobile receive screen shows a 60s countdown that looked like a bug.This aligns the backend with the real IBEX limit so we never request an expiration IBEX will ignore.
Changes
invoice-expiration.ts— add a documentedIBEX_RECEIVE_MAX_EXPIRATION_SECONDS(60s) constant recording the IBEX account-type limit, anibexReceiveDefaultExpirationMinutesdefault, and a purecappedIbexReceiveExpiration()clamp.ibex/client.ts— clampexpirationcentrally in theaddInvoicewrapper (the single choke point for every IBEX receive invoice), so no caller can request more than 60s, regardless of an explicitexpiresInoverride.add-invoice-for-wallet.ts— default the USD receive flows to 60s instead of 300s.invoice-expiration.spec.tswith the policy, including a regression guard that a 5-minute (300s) request can never reach IBEX.Notes / decisions
prToDateString/decodeInvoiceString(...).timeExpireDateString), so it will correctly show 60s.Ibex.addInvoice, so the legacy no-amount / LNDWalletInvoiceBuilderpath is untouched.undefinedexpiration is passed through so IBEX applies its own account default.Acceptance criteria
Closes ENG-427.
🤖 Generated with Claude Code