Repository navigation
fix(send): disclose when the network fee is deducted from the amount - #708
Merged
Merged
Conversation
Fixes the actionable half of #694. On external sends from cash wallets, IBEX's pre-send estimate for some routes is 0 while settlement deducts the real routing fee FROM THE AMOUNT: the repro was a $1.10 send that displayed "$0.00" fee, debited $1.10, and delivered $1.07. The app cannot conjure the true fee pre-send — IBEX does not provide it on those routes — so an unqualified $0.00 is a claim the settlement then breaks, and the customer discovers the fee on the recipient's side. The confirmation screen now renders, under exactly that case, the note: "The network fee is deducted from the amount — the recipient may receive slightly less." The predicate (fee-from-amount.logic.ts) discloses only on a PROBED zero from a cash wallet on an external send, and each exclusion is a decision: - intraledger stays silent because free is TRUE there, and crying wolf teaches users to ignore the caveat exactly where it matters - BTC-wallet sends stay silent because their probes price the actual route — a zero there is a genuinely free path - loading/error/unset stay silent because those states already carry their own caveats A rare genuinely-free external route reads the soft copy — a mild false positive, priced against the current false NEGATIVE. i18n: key added at the source (app/i18n/en/index.ts), types and raw exports regenerated via yarn update-translations, all 23 locales filled (Spanish translated, others English fallback, matching #706's convention). Drift check green. Deliberately NOT in this PR: making the probe honest server-side (IBEX does not expose the fee on these routes) and showing the actual settled fee in the transaction detail — tracked in the issue as follow-ups. 88 suites / 867 tests green; tsc and eslint clean. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
… payee node, type paymentType, render tests Applies the three review findings on #708: 1. Render-level disclosure tests. The predicate was fully unit-tested but nothing asserted the component actually renders the caveat, so a wiring regression (e.g. passing fee.amount, the object, instead of fee.amount?.amount) would silently kill the feature with every test green. ConfirmationWalletFee.test.tsx now pins a probed-zero render showing the disclosure, a priced-fee render omitting it, and the Flash-node suppression end to end (mutation-tested: breaking the feeAmount wiring fails the probed-zero case). 2. paymentType is now the PaymentType union BasePaymentDetail uses, compared against PaymentType.Intraledger, so the predicate's most safety-critical exclusion is compiler-checked instead of stringly typed. 3. The "rare genuinely-free external route" framing was unverified — and turned out wrong. Verified live on the Test instance (2026-08-24): minting a Flash-internal USD invoice and probing it via lnUsdInvoiceFeeProbe returns a SET fee of 0 (the backend probe is a blind pass-through to IBEX estimate-fee, no internal-invoice special-casing — flash ln-usd-invoice-fee-probe.ts). Without a guard the caveat would fire on every Flash-to-Flash invoice payment, teaching users to ignore it exactly where it matters. The predicate now suppresses when the held bolt11's payee node pubkey is one of the instance's own lnNodePubkeys (new galoy-instances field; globals.nodesIds is empty on prod and test, verified live, so the ids ship as config). Test's node id is pinned and verified (IBEX_SB); Main's list is deliberately empty until someone with a prod account decodes a prod receive invoice — recipe in galoy-instances.ts. Suppression fails open: no invoice, undecodable invoice, or an empty list all still disclose. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
… memoize invoice decode Round-2 review fixes for #708: - Main's lnNodePubkeys was empty, leaving the Flash-to-Flash caveat suppression inert on prod — the disclosure fired on every prod Flash-to-Flash invoice payment despite full-amount delivery. Pinned 03501a74…ac106 (IBEX_Ops1), verified 2026-08-24 by minting five live prod invoices via the LNURL-pay callback across two accounts and four amounts (1 to 50,000 sats); all decode to this single payee. Tests now decode a real prod invoice and fail if the pin regresses or drifts. - payeeNodePubkey ran eagerly on every render, re-doing sync ECDSA pubkey recovery on each fee/quote state transition. Memoized on paymentRequest; a render test counts decode calls and fails on the eager version (verified: 2 calls un-memoized, 1 memoized). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
The earlier locale fill rewrote the 23 translation JSONs through a JSON parser, which silently DEDUPED a literal duplicate 'allowanceExhausted' line that main carries — runtime-neutral (parsers collapse duplicates anyway) but 23 files of unrelated diff bundled into a send-flow PR. Restored main's exact bytes and re-inserted feeDeductedFromAmount as a text edit. The translations diff vs main is now pure additions: one line per file. Verified: zero deletion lines, all 23 files parse, drift check green, 880 tests green. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
islandbitcoin
pushed a commit
that referenced
this pull request
Aug 24, 2026
Lori's app-audit P1: the fee row carried the same visual weight as every other data row, on the screen where Flash's zero fee IS the product moment — a transfer that costs J$1,500-2,000 through a typical remittance service costs nothing here. The row now reads 'Flash fee', the value renders in the theme's green, bold, and a small gray line underneath says 'Typical remittance services charge J$1,500-2,000 for this.' Copy chosen with Jabari: the comparison lands without naming a competitor in-app (brand rule: no punching). THE INTEGRATION DECISION, pinned by a property test: celebration and the fee-from-amount disclosure (#694) are mutually exclusive by construction. shouldCelebrateZeroFee fires only on a settled zero that shouldDiscloseFeeFromAmount has nothing to say about — a row that says '$0.00, we're proud of it' directly above 'the network fee is deducted from the amount' would be the app contradicting itself on a money screen. The test sweeps every paymentType x currency combination and asserts both never fire together. Color note: #561 asked for #3ab54a, which is not in the theme palette; uses colors.green (defined for light AND dark) rather than hardcoding an off-theme hex. One-line palette add if the exact brand hex is wanted. i18n at the source, 23 locales filled (es translated), drift green. Based on fix/fee-from-amount-disclosure — merges after #708. 88 suites / 884 tests green. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
islandbitcoin
added a commit
that referenced
this pull request
Aug 25, 2026
* feat(send): give the zero fee the prominence it earns (#561) Lori's app-audit P1: the fee row carried the same visual weight as every other data row, on the screen where Flash's zero fee IS the product moment — a transfer that costs J$1,500-2,000 through a typical remittance service costs nothing here. The row now reads 'Flash fee', the value renders in the theme's green, bold, and a small gray line underneath says 'Typical remittance services charge J$1,500-2,000 for this.' Copy chosen with Jabari: the comparison lands without naming a competitor in-app (brand rule: no punching). THE INTEGRATION DECISION, pinned by a property test: celebration and the fee-from-amount disclosure (#694) are mutually exclusive by construction. shouldCelebrateZeroFee fires only on a settled zero that shouldDiscloseFeeFromAmount has nothing to say about — a row that says '$0.00, we're proud of it' directly above 'the network fee is deducted from the amount' would be the app contradicting itself on a money screen. The test sweeps every paymentType x currency combination and asserts both never fire together. Color note: #561 asked for #3ab54a, which is not in the theme palette; uses colors.green (defined for light AND dark) rather than hardcoding an off-theme hex. One-line palette add if the exact brand hex is wanted. i18n at the source, 23 locales filled (es translated), drift green. Based on fix/fee-from-amount-disclosure — merges after #708. 88 suites / 884 tests green. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV * fix(send): review fixes — render-level #561 coverage, drop dead feeLabel, revert drive-by churn - send-confirmation.spec.tsx: assert the rendered celebration (green fee + 'Zero Fee Comparison' with the real copy) on the Intraledger story, and that an external-USD probed zero renders the fee-from-amount caveat with no celebration — pinning the ConfirmationWalletFee wiring the predicate unit tests cannot see (both cases verified to fail under a wired-wrong component) - i18n: delete the now-dead SendBitcoinConfirmationScreen.feeLabel from the source dictionary and regenerate types; stale key in translation files is dropped by the locale sync - revert unrelated style refactors in ConfirmationError.tsx and DetailDestination.tsx to keep the PR surface at #561 Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV * fix(i18n): remove stale SendBitcoinConfirmationScreen.feeLabel from all raw translations Review fix for PR #709: the dead feeLabel key was removed from the source dictionary in round 1, but no locale sync exists to drop it from the 23 raw translation JSONs (check-translation-drift only flags missing keys, never extras), so the stale key would persist and could silently resurrect as mistranslations if feeLabel were ever reintroduced with a different meaning. The JSON round-trip also dedupes a pre-existing exact-duplicate TopUpAmountScreen allowanceExhausted key (identical value in both occurrences of every file), which is semantics-preserving. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV --------- Co-authored-by: Dread <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
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.
Fixes the actionable half of #694.
The bug, honestly scoped
On external sends from cash wallets, IBEX's pre-send estimate for some routes is 0 while settlement deducts the real routing fee from the amount — the repro: $1.10 sent, "$0.00" fee displayed, $1.07 delivered. The app cannot conjure the true fee pre-send; IBEX does not provide it on those routes. So "make the number right" is not available — what's available is to stop presenting the 0 as a promise.
The fix
Under exactly that case, the confirmation screen adds:
The predicate (
fee-from-amount.logic.ts) fires only on a probed zero from a cash wallet on an external send. Each exclusion is a decision, each pinned by a test:A rare genuinely-free external route reads the soft copy — a mild false positive, priced against the current false negative: a customer discovering the fee on the recipient's side.
i18n
Key added at the source (
app/i18n/en/index.ts), types + raw exports regenerated, all 23 locales filled (Spanish translated, others English fallback — #706's convention).check:translation-driftandcheck:translationsboth green.Deliberately not here (follow-ups on the issue)
88 suites / 867 tests; tsc + eslint clean.