Skip to content

feat: update spending balance modal - #1967

Open
ovitrif wants to merge 46 commits into
fix/spark-follow-upsfrom
feat/spark-update-spending-balance-v64
Open

ovitrif wants to merge 46 commits into
fix/spark-follow-upsfrom
feat/spark-update-spending-balance-v64

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1982

Stacked on #1957
Refs: #1946
Companion: synonymdev/bitkit-e2e-tests#316

Description

  • Replaces the Move to Spark screens with the v64 modal: "Update Spending Balance" with the live routing fee as "Update fee: ", Later and Update; on success "Spending Balance Updated" with OK. The one-time sheet and the Move To Spark buttons on Spending and Lightning Connections all open it.
  • Once the move settles, every channel it emptied is closed cooperatively and gets the usual transfer row; a failed close leaves the channel for a manual close. Channels that could send less than the move minimum are left alone.
  • A Lightning payment that only the channels and Spark together can cover runs with one swipe: the confirm screen adds an "Update fee" row and opens its details so the fee shows before the swipe, which waits for the quote, the swipe moves the channel balance to Spark, then pays from Spark.
    • At swipe time, and again right before the move, the update is quoted again; if its fee rose, or none was shown, the payment returns to confirm with the new fee and nothing moves.
    • An LNURL-pay that needs the update shows its fee before the first swipe.
    • Any failed update releases a payment request instead of leaving it pending.
    • Before moving, the quote and Spark's balance must cover the payment; otherwise nothing moves.
    • A payment request refused by its allowance check moves nothing.
    • If the payment fails after the move, the funds stay in Spark and the usual payment error shows.
    • QuickPay never sends such a payment; Pubky swaps are quoted only with what one rail can pay.
  • Removes the Spark Route row from the send confirm screen.
  • Removes the CJIT receive card, its button and the liquidity flow; CJIT history stays. Without Lightning receive, the Spending and Auto receive tabs hide.
  • Translates the new strings into every shipped locale and drops the removed keys from each.

Out of Scope

  • If the app is killed after a move settles and before its channels close, they stay open for a manual close.
  • States without frames (a move in flight, nothing to move, too large, failed) keep today's behaviour in the modal.

Design

Figma page "Bitkit - Progress v64" in the Bitkit Wallet file:

Preview

Figma frame on the left, the app on the right.

Figma App
Update Spending Balance
Spending Balance Updated

Screens without a v64 frame

Send confirm with the Update fee row Receive without the CJIT card

Recordings at 2x

J1: move to Spark J2: payment with an update J3: transfer unavailable
j1.mp4
j2-update-spending-balance-payment2x.mp4
j3.mp4
J4: USDT receive tabs J5: receive tabs wraparound
j4.mp4
j5.mp4

Figma notes

Every note above the v64 frames for these flows, with what this PR does about it.

Modal Update Spending balance (Spark)

  • "Bitkit is switching Lightning providers. Update your spending balance … Update fee": this PR, with the live routing fee

Modal Update Spending (Spark) done

  • "Funds moved to spark": this PR shows it once the move succeeds
  • "Also auto close channel after sending the funds to Spark balance": this PR closes every channel the move emptied

Changelog v64

Renew Instant Payments Connection

  • Renew, review and renewed: does not apply; renewing a Blocktank connection has no meaning with Spark

Blocktank Sunsetting

QA Notes

Setup

  • Local Spark regtest stack from synonymdev/bitkit-docker (docs/spark-regtest.md), so the wallet holds an LDK channel to the stack's SSP Lightning node on the same chain as Spark.
  • Dev build (regtest) pointed at that stack: its local Spark config (SPARK_LOCAL_CONFIG_B64 from the docs), Electrum on the stack, and the stack's chain shared with Spark; this branch has no build setting for a local Spark, so this is a local patch to the build, not part of this PR.
  • J1: new wallet with 500 000 sats in savings and a 400 000-sat channel to the SSP node.
  • J2: new wallet with 500 000 sats in savings, 30 000 on Spark, a 32 000-sat channel, QuickPay off, and a 50 000-sat invoice from another node on the stack.
  • J3: a plain regtest build; for steps 6–9 Spark must fail to start (replace files/regtest/wallet0/spark with a file through run-as).

Journeys

  • J1: updated move-to-spark.xml — Update modal with its fee, Later, Update, Updated modal, emptied channel closed — passed on 2ada21c75
  • J2: added update-spending-balance-payment.xml — a payment only channels and Spark together cover: "Update fee" row, no Route row, one swipe — passed on ec9145415; its action 2 (details open on their own) changed in 76b903e and is covered by SendConfirmUpdateFeeTest.kt
  • J3: updated transfer-unavailable-sheet.xml — with Spark down, the funding options and Receive without Lightning tabs — passed on 754638d64, steps 6–9 with Spark failing to start
  • J4: updated usdt-receive-swipe-tabs.xml — tabs without the CJIT card — passed on 754638d64
  • J5: updated receive-tabs-wraparound.xml — fails at step 10 (a right swipe above the sheet keeps Savings selected); the same on master, tracked in bug: savings swipe released above the receive sheet keeps savings #1966
  • J6: updated paykit-spark-route.xml (Route row removed) — not run: needs an E2E local-backend build and a paykit stack with a Pubky profile

Automated Checks

  • added MoveToSparkRepoTest.kt — quotes, coverage of a payment, the update falling short
  • added CloseChannelUseCaseTest.kt — closes only the channels a move emptied, after a sync
  • updated MoveToSparkViewModelTest.kt — modal states and the re-quote at swipe
  • updated AppViewModelSendFlowTest.kt — combined payment: re-quote at swipe and at send time, LNURL-pay quote, allowance check before moving, failed updates releasing requests, payment failing after the move
  • added SendConfirmResetTest.kt — repeated fee resets each release the swipe
  • updated AppViewModelSendFlowTest.kt — the swipe waits while the update is quoted
  • added SendConfirmUpdateFeeTest.kt — the Update fee shows without opening the details
  • updated PaymentFailureReasonExtTest.kt — a failed update shows the existing payment failure copy
  • updated ReceiveQrScreenTest.kt, WalletRepoTest.kt, SendConfirmLnurlOnchainTest.kt; removed ReceiveLiquidityDecisionTest.kt, EditInvoiceVMTest.kt with the CJIT flow

Evidence

On a regtest emulator (Android 15, 896×1994 at 320 dpi) with the local Spark stack:

  • J1: the modal read "Update fee: ₿ 2"; Later kept it away after a relaunch; Update moved 395 458 sats to Spark and showed "Spending Balance Updated"; the channel closed with its 3 372-sat remainder sent to savings, and the Move To Spark button was gone.
  • J2 (on ec9145415): confirm showed 50 000 with "Update fee ₿ 2", no "up to" and no Route row; after the over-half-balance dialog, one swipe moved 30 458 to Spark and sent 50 000 from Spark, which priced the payment above its 30 000 balance; the emptied channel closed with ↑1 542 / ↓29 458 and savings received 372 sats.
  • Between 754638d64 and 2ada21c75 only the update and payment guards (1f912de0d) and journey text changed; J3 and J4 cover screens those guards do not touch.

Gaps

  • J5 step 10 and J6, as above.
  • If the app is killed after a move settles and before its channels close, they stay open for a manual close.

Models used

  • Planning/scoping: Claude Opus 5.5 (reasoning: medium)
  • Implementation: Claude Opus 5.5 (reasoning: medium), Claude Sonnet 5.5 (reasoning: high)
  • Review: Claude Sonnet 5.5 (reasoning: high), Claude Opus 5.5 (reasoning: medium)

Verified: just format, just compile, just test, just lint, androidTest compile
Verified: just format, just compile, just test, just lint, androidTest compile
Verified: just compile, just test, just lint
…spark-update-spending-balance-v64-fix

# Conflicts:
#	app/src/main/java/to/bitkit/ui/ContentView.kt
@ovitrif ovitrif added this to the 3.2.0 milestone Nov 18, 2026
@ovitrif ovitrif self-assigned this Nov 18, 2026
@ovitrif
ovitrif requested review from a team, ben-kaufman and coreyphillips and removed request for a team November 18, 2026 01:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T01:13:18.804287Z 1a2ffa8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[Critical impact] The PR changes how wallet balances move and how Lightning payments are sent.

Fix the payment coverage check and repeated confirmation resets before merging.

Findings

  1. P1 Payment coverage misses routing fees ▶
  2. P1 Repeated fee changes freeze confirmation ▶

Summary

Replaces the Move to Spark screens with an Update Spending Balance modal and adds payments funded by both channel and Spark balances.

  • The spending balance sheet moves channel funds to Spark.
  • A Lightning payment can use Spark after channel funds move.
  • Receive screens no longer offer the CJIT liquidity flow.

Two issues need attention: the coverage check leaves out the payment’s routing fee, and repeated fee changes can leave confirmation stuck.

ovitrif explicitly leaves channel-close recovery after the app is killed out of scope. ovitrif also identifies the receive swipe failure as pre-existing (#1966) and notes that the Pubky journey was not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Open Update modal] --> C[Quote channel move]
  B[Confirm combined-balance payment] --> D[Quote again and check shown fee]
  D --> E[Check request and payment coverage]
  E --> F[Move channel funds to Spark]
  C --> F
  F --> G[Wait for move to settle]
  G --> H[Close emptied channels and record transfers]
  G --> I[Pay recipient from Spark]
  G --> J[Show modal result]
Loading

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/fix..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a2ffa8f2a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 7d3e9c4 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@talosmachina talosmachina left a comment

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.

1 finding (1 P1). Replaces the Move to Spark screens with the v64 Update Spending Balance modal, adds a one-swipe channels-to-Spark update before a Lightning payment that neither rail covers alone, auto-closes emptied channels, and removes the CJIT receive flow. Reviewed 1a2ffa8, oversized tier (59 files, about 2,900 changed lines).

What I checked, and 5 candidates I ruled out

Read in depth: MoveToSparkRepo.kt (quote, move, updateToSend, MoveToSparkMath), CloseChannelUseCase.kt, MoveToSparkManager.kt, MoveToSparkViewModel.kt, the AppViewModel.kt hunks (canSendLightning, confirmSparkUpdateQuote, updateSpendingBalanceIfNeeded, estimateSparkUpdateFees, the QuickPay and swap-route guards), SendConfirmScreen.kt, SendSheet.kt, LightningRepo.payInvoice/shouldPayWithSpark/estimateMaxSendFee, SparkRepo.payInvoice/estimateFeeSats/maxSendReserveSats, SparkFees.
Not reviewed: the receive-screen CJIT removal beyond the tab list, the journeys, and the locale files.
Build: not built here. Bitkit Android branches are reviewed from the code and from CI only. CI: build, unit tests, lint, detekt and compose UI tests green; several e2e shards still pending at review time.
Cold reader: not run for the finding below (the review ran out of time). It stands on the traced path and nothing else.

Ruled out

  • Two moves paying from the same channel balance: moveLock in move() serialises the modal's move and a payment's update.
  • Allowance-refused request moving funds: ensurePaymentAllowed runs before updateSpendingBalanceIfNeeded when an update is needed.
  • QuickPay sending a payment that needs an update: handleQuickPayIfApplicable returns false before canApplyQuickPay.
  • Fee rising between review and swipe: confirmSparkUpdateQuote re-quotes and resets the confirm screen through SendEffect.ResetConfirm, which SendConfirmScreen consumes.
  • Proof left behind after a failed update: clearFailedLightningPayment treats MoveToSparkError like a failed payment.

Merge confidence: 3/5, one P1, and the oversized tier caps it there anyway.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the run metadata available to this reviewer names no effort setting)

@coreyphillips coreyphillips left a comment

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.

Two independent reviews.

worth doing, does not block

  • LNURL-pay that needs the update always bounces on the first swipe (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:7903-7908) [one reviewer only]
  • Update coverage check leaves out Spark's routing fee (app/src/main/java/to/bitkit/repositories/MoveToSparkRepo.kt:398) [one reviewer only]
  • Spark retry-hold and exit-backup changes are not in the description (app/src/main/java/to/bitkit/repositories/SparkRepo.kt) [one reviewer only]. Commits 244833e, d93f61e, 9e9fe4a and 61730cb change how Spark send outcomes are held and reported. They touch: - the new takenAttempts map - dropExpiredTakenAttempts, which emits late payment events on Synced - which list read activity rows are recorded against - CacheStore.keepSparkSendAttempt - when BackupRepo.uploadSparkExitBackup merges the stored exit backup None of this appears in the PR description, QA notes or journeys, which cover only the modal and the combined payment. Someone reviewing or testing #1967 has no reason to look at these payment-state changes. Either move them to the base (#1957), or describe them here with their own QA cases.
  • Payment coverage ignores the recipient's routing fee (app/src/main/java/to/bitkit/repositories/MoveToSparkRepo.kt:398)
  • Unwrapped update failures leave payment requests pending (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:7934)
  • Repeated fee refreshes leave confirmation loading (app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt:328)

nits

  • New payment journey has no iOS twin or cross-platform table row (journeys/README.md) [one reviewer only]. CLAUDE.md asks that a journey be ported to iOS, or listed in the cross-platform table in journeys/README.md with a note on what is missing. This PR adds send/update-spending-balance-payment.xml and rewrites transfer/move-to-spark.xml, but it lists no Twin and the table has no row for either.

the reviewers disagree, your call

  • Balance changes can bypass migration fee confirmation (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:7881)

Verified: just format, just compile, just test, just lint
Verified: just format, just compile, just test, just lint
Verified: just format, just compile, just test, just lint
@ovitrif

ovitrif commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

@coreyphillips

Spark retry-hold and exit-backup changes are not in the description

Those commits (244833e, d93f61e, 9e9fe4a, 61730cb) belong to #1957, this PR's base; they arrived through the base merge and are not in this PR's diff (SparkRepo.kt, BackupRepo.kt and CacheStore are unchanged against fix/spark-follow-ups). Their QA lives on that PR.

New payment journey has no iOS twin or cross-platform table row

The iOS twin opens after synonymdev/bitkit-ios#1355 merges and carries both journeys with the same ids; I'll add its Twin line here then.

The other points are answered in their threads.

@coreyphillips coreyphillips left a comment

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.

Rechecked after 2 new commits (aff7c0a, 2de3e68). 1 blocking finding the reviewers disagree about.

addressed

  • Update coverage check leaves out Spark's routing fee (app/src/main/java/to/bitkit/repositories/MoveToSparkRepo.kt:398). Fixed: updateToSend now prices the payment with feeAfterUpdateOrNull (MoveToSparkRepo.kt:153-157). coversPayment (411-412) requires balance + quote.amountSats >= amount + fee, and a fee nothing can price refuses before move. I read the new code and the two new tests in MoveToSparkRepoTest.kt, and CI build-and-test passes on 2de3e68. The wait loop still checks canSend only, but the pre-move check has already established the balance is enough. Max can now be refused instead of moving funds, which is what the PR promises. The fallback's reach is a separate new finding.
  • Payment coverage ignores the recipient's routing fee (app/src/main/java/to/bitkit/repositories/MoveToSparkRepo.kt:398). Fixed: Same change as point 2 (MoveToSparkRepo.kt:153-157, 411-412). In your example the check now compares 30,000 + 29,998 = 59,998 against 59,600 plus Spark's quoted fee (449 with a 300-sat route), so it throws UpdateFallsShort before move. When the fee cannot be priced, nothing moves either.

still open

  • LNURL-pay that needs the update always bounces on the first swipe (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:7903-7908) [one reviewer only]. Every LNURL-pay that needs a spending balance update takes two swipes, and the first one bounces back with no message. The LNURL invoice is only fetched inside proceedWithPayment, after confirmSparkUpdateQuote has run. estimateLightningRoutingFeesIfNeeded returns early at currentState.decodedInvoice ?: return (line 8614), and the fixed-amount LNURL path goes to Confirm without estimating anything. So sparkUpdateQuote is always null on the LNURL confirm screen. The result is that the "Update fee" row added to LnurlPayDetails never shows before the swipe. On every first swipe, confirmSparkUpdateQuote takes its shown == null branch and emits ResetConfirm. With PIN for payments on, that also means two PIN prompts. I found this by reading the code. J2 only covers a BOLT11 invoice. One fix: quote the update in estimateLightningRoutingFeesIfNeeded when lnurl is LnurlPay and needsUpdateToSend(amount) is true, so the fee shows before the first swipe. Unchanged since the last review, and there is no reply. estimateLightningRoutingFeesIfNeeded still returns at decodedInvoice ?: return (AppViewModel.kt:8614) before an LNURL invoice exists. confirmSparkUpdateQuote (7903-7908) still emits ResetConfirm when shown == null, so an LNURL-pay that needs an update still bounces on the first swipe.
  • Spark retry-hold and exit-backup changes are not in the description (app/src/main/java/to/bitkit/repositories/SparkRepo.kt) [one reviewer only]. Commits 244833e, d93f61e, 9e9fe4a and 61730cb change how Spark send outcomes are held and reported. They touch: - the new takenAttempts map - dropExpiredTakenAttempts, which emits late payment events on Synced - which list read activity rows are recorded against - CacheStore.keepSparkSendAttempt - when BackupRepo.uploadSparkExitBackup merges the stored exit backup None of this appears in the PR description, QA notes or journeys, which cover only the modal and the combined payment. Someone reviewing or testing #1967 has no reason to look at these payment-state changes. Either move them to the base (#1957), or describe them here with their own QA cases. Codex still sees it: The requested diff against origin/fix/spark-follow-ups still includes all three files at the supplied base 037c771. The 02:05 response matches their history through merge parent 61730cb, but remote access failed, so I could not confirm their exclusion from the current PR.
  • New payment journey has no iOS twin or cross-platform table row (journeys/README.md) [one reviewer only]. CLAUDE.md asks that a journey be ported to iOS, or listed in the cross-platform table in journeys/README.md with a note on what is missing. This PR adds send/update-spending-balance-payment.xml and rewrites transfer/move-to-spark.xml, but it lists no Twin and the table has no row for either. Journeys/README.md's cross-platform table still has no row for send/update-spending-balance-payment.xml or the rewritten transfer/move-to-spark.xml, and there is no Twin line. A Twin promised after bitkit-ios#1355 merges is a plan, not a port. A table row saying the iOS port is pending would close this nit.
  • Balance changes can bypass migration fee confirmation (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:7881). If Spark's balance drops while an LNURL invoice callback is pending, channels can migrate without showing an update fee. The earlier confirmation check passes while Spark can pay alone. This later call then passes a null quote to updateToSend(), which quotes and moves immediately. I confirmed this using the production repository and extracted confirmation methods: a 60,000-sat payment with 50,000 sats in channels migrated after Spark fell from 70,000 to 20,000 sats, without emitting ResetConfirm. AppViewModel.kt:7881 still passes _sendUiState.value.sparkUpdateQuote. That is null when confirmSparkUpdateQuote returned early because no update was needed then, so updateToSend still quotes and moves without a ResetConfirm. The new coverage check does not stop the 70k to 20k case: 20,000 plus a ~49,900 move covers 60,000 plus its fee. I agree this is non-blocking and fine to track in #1968, but the deferral is not a fix or a rebuttal.
  • Unwrapped update failures leave payment requests pending (app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt:7934). A move refused with NodeException.InsufficientFunds leaves a payment request pending although its invoice was never sent. move() preserves this error, so it misses the MoveToSparkError branch and the proof layer returns false. I confirmed this with a refused update and the production cleanup method bodies. The pending branch then retains the recipient hash and proof without a recipient payment that can settle them. There is no reply and no change. clearFailedLightningPayment (AppViewModel.kt:7926-7939) still sends errors that are not MoveToSparkError to failLightningPayment(paymentHash, error). updateToSend still lets raw errors through unwrapped, for example sparkRepo.createInvoice(...).getOrThrow() in quote (MoveToSparkRepo.kt:206) and the payInvoiceOverLdk errors rethrown at 267-270. A Paykit request whose invoice was never sent can therefore still be tracked as pending.
  • Repeated fee refreshes leave confirmation loading (app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt:328). A second fee-refresh reset leaves confirmation spinning. SendConfirmScreen removes the saved-state key after the first reset, detaching its existing StateFlow. This new in-place reset keeps using that collector. I reproduced two reset events against the shipped saved-state implementation: only the first cleared loading. An LNURL payment with no initial quote followed by a fee increase reaches this sequence. Neither file changed and the Codex thread on SendSheet.kt:332 has no reply. SendSheet.kt:328-331 still sets SEND_CONFIRM_RESET_RESULT_KEY in place. SendConfirmScreen.kt:156-161 still collects it with getStateFlow and removes the key after the first reset, so a second reset on the same Confirm screen never reaches the collector.

new since the last review

worth doing, does not block

  • Update fee fallback cannot price any payment that needs an update (app/src/main/java/to/bitkit/repositories/MoveToSparkRepo.kt:188-191)

Quotes LNURL-pay updates before confirm, releases payment requests on any update failure, keeps repeated confirm resets observable, and stops a send whose update fee was not shown or rose since.

Verified: just format, compile, test, lint
Spark's prepare prices any amount whatever its balance, so the LDK routing fallback could never price a payment that needs an update. Also lists the new journeys' pending iOS port.

Verified: just format, compile, test, lint

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code scan at ec91454, covering this PR's diff on top of #1957: no HIGH or MEDIUM. Two LOWs are inline, and one docs LOW is below.

LOW (docs): docs/receive-liquidity.md still describes the removed flow. Lines 3-5 and 44 send the user to the Transfer Unavailable screen, and lines 29-30 describe the Spending tab's onboarding view. Both are gone: the Spending and Auto tabs now hide without Lightning receive (ReceiveQrScreen.kt:155-159), and editing calls updateInvoice (EditInvoiceScreen.kt:100-103). Update or delete the doc.

What I checked:

  • Nothing moves unconfirmed. confirmSparkUpdateQuote and updateSpendingBalanceIfNeeded re-quote and return to confirm when no fee was shown or the fee rose.
  • No double pay. moveLock serialises the modal's move and a payment's update. onConfirmPay refuses a second submission. After process death, the persisted LDK payment settles by itself.
  • Channel closes. closeEmptiedByMove closes only channels that could send 1,000 sats before the move and can't after, only after a Moved outcome or a settled in-flight success, and only cooperatively.
  • Balances. DeriveBalanceStateUseCase changes only maxSendLightningSats; totals are untouched.
  • Modal lifecycle. Later, Back and swipe-dismiss during a move keep it (reset returns while isMoveInFlight), and reopening shows it. Dismissing while quoting cancels the quote. The one-time sheet's Failed state offers Try again, and the sheet can be reopened from Spending and Lightning Connections.
  • Journeys and screens map. The six journeys match the head's tags and copy. The screens map drops the removed screens and adds MoveToSparkSheet.kt with both frames.
  • Figma. Update Spending Balance (52052:404808) and Spending Balance Updated (52052:409823) match in copy, accent split, the bold fee tail, buttons and illustrations. The frame breaks "UPDATED" onto its own line, while the app relies on wrapping at 44sp.
  • iOS twin. None yet, and journeys/README.md records the port as pending.

perf: relevant. Every quote() creates a new 1-hour Spark invoice plus up to 4 route estimates. It runs on each modal open, on each fee estimate for an update payment, at swipe and again at send: at least three invoices per combined payment. A swipe can then wait up to 2 min for the move plus 60 s of 2 s polling.

Device gate (partial): ec91454 — not run yet; pending: send/update-spending-balance-payment.xml, transfer/move-to-spark.xml, transfer/transfer-unavailable-sheet.xml, the receive tab journeys and paykit-spark-route.xml on the Spark regtest stack, with swipe → "Bitcoin Sent" timing and quote counts per confirm visit. Device results and the final review type follow in a second review.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (d8e1de5: a send Spark took stays held until it settles or its invoice expires) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (63135ae: Spark's sync sweep also settles a hold that was only saved) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (7444b24: an older attempt's failure no longer overwrites a later failed attempt's Activity row) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (d45d997: a Spark send stays in flight until its result is handled) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (50fae11: saved Spark holds are taken back under the same lock a send uses to leave flight) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (1ea4fdd: a settled Spark hold is taken under the restore lock) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (2c94820: a Spark send's outcome is reported once per payment id) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (a5094aa: the Spark poll reports a settled send from the payment it read) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (5306637: Spark keeps a settled failure off a retry in flight) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (5f79ba2: Spark keeps a retry's saved send through the poll) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (cc0cc6c: a Spark failure event keeps a retry's hold) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (d20d1c7: a Spark failure event leaves a retry's screen alone) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (8573baf: starting a Spark retry clears earlier failures) into this PR. The merge had no conflicts and only touches SparkRepo.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (844626f: Spark sync settles only holds from before its list) into this PR. The merge had no conflicts and only touches SparkRepo and its tests.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged #1957's new head (ff2687e: an unsynced Spark refuses a send the operator failed) into this PR. The merge had no conflicts and only touches SparkRepo.

This branch has not been deployed

No deployments
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.

5 participants