Skip to content

fix: dismiss the update spending balance modal - #316

Open
ovitrif wants to merge 2 commits into
mainfrom
feat/spark-update-spending-balance-v64
Open

ovitrif wants to merge 2 commits into
mainfrom
feat/spark-update-spending-balance-v64

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The e2e helpers now recognise every state of the new Update Spending Balance modal, not only the old Move to Spark intro. The modal quotes on open and can switch state (to "too large", "partly moved", "failed" or "updated") before the dismiss tap lands.
  • dismissMoveToSparkIntroIfShown taps whichever dismiss button is showing: MoveToSparkIntroLater, UpdateSpendingBalanceLater, UpdateSpendingBalanceDismiss or SpendingBalanceUpdatedOk. It waits for that button to hold still for 1 s, waits for the sheet to close, and taps the new button when the state changed under the tap (up to 3 taps).
  • Callers keep their names and signatures. The old intro ids stay, so app branches without the new modal still pass.

Companion: synonymdev/bitkit-android#1967

Verification

  • npx tsx --test test/unit/*.test.ts passes, including new Android and iOS cases for a quote that turns "too large" 500 ms after opening, a state change under the tap, and an "updated" sheet dismissed with OK. The "too large" case fails with the settle window set to 0.
  • ESLint on test/**/*.ts, tsc --noEmit and Prettier on both changed files are clean.
  • Not run on an emulator; the app PR's E2E run is the first device run.

Out of scope

  • @blocktank_sunset_2 in test/specs/mainnet/blocktank-sunset.e2e.ts needs a rewrite: a fresh wallet no longer reaches the receive-side Transfer Unavailable route, since the Spending tab now shows only when a Lightning invoice can be created. That mainnet-only spec is not run by the app PR's CI.

The Move to Spark intro is now the Update Spending Balance modal, which
quotes on open. On local regtest the quote fails within about half a
second and the modal switches to its too-large state, so the helpers,
which only knew MoveToSparkIntroLater, left payment and timed-sheet
tests stuck behind it.

- Treat any Move to Spark state as the sheet being shown: MoveToSparkIntro,
  UpdateSpendingBalance, SpendingBalanceUpdated, MoveToSparkTooLarge,
  MoveToSparkFailed, MoveToSparkInFlight and MoveToSparkPartlyMoved, with
  one combined selector per poll.
- Dismiss with whichever of MoveToSparkIntroLater,
  UpdateSpendingBalanceLater, UpdateSpendingBalanceDismiss or
  SpendingBalanceUpdatedOk is shown, once it has held still for 1 s, then
  confirm the sheet closed and tap again if its state changed under the tap.
- Keep the old intro ids so the base app branch still passes.
- Cover the too-large flip, a state change under the tap and the moved
  state in the unit test on both platforms.

Verified: npx tsx --test test/unit/*.test.ts (all pass), npx eslint 'test/**/*.ts', npx tsc --noEmit -p ., npx prettier --check on the changed files
@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 02:07
@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-18T02:09:31.967057Z c62e6cc 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.

@talosmachina talosmachina 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.

1 finding (1 P1). Teaches the Move to Spark dismiss helper the new Update Spending Balance modal states. Reviewed c62e6cc, full tier, static: build skipped, talos-pr-run could not check the author's permission on this repo and fails closed, so the unit tests were not run here.

What I checked, and 3 candidates I ruled out

Read in full: the diff of test/helpers/actions.ts and test/unit/late-usdt-intro.test.ts; MoveToSparkSheet.kt and Button.kt at synonymdev/bitkit-android#1967 head 2de3e680
Call sites traced: dismissMoveToSparkIntroIfShown from restoreWallet, acknowledgeReceivedPayment, triggerTimedSheetUnlessPresent, dismissInterveningSheets, withMoveToSparkIntroRecovery
CI: no checks on this PR; the companion app PR's local e2e shards were still running

Ruled out

  • Combined selectors: Android resourceIdMatches with a|b|c is a full-match regex and none of the ids carry regex metacharacters; the iOS name IN {...} predicate is well formed.
  • Settle loop on the Update state: UpdateSpendingBalanceLater is a SecondaryButton whose testTag lands on the OutlinedButton, so it is found and enabled while the quote loads.
  • iOS base branch: bitkit-ios still ships MoveToSparkIntroLater only, and that id stays in the list.
  • Cold reader: the finding stood.

Merge confidence: 3/5, one P1 on the path the PR targets.

Comment thread test/helpers/actions.ts Resolved
Comment thread test/helpers/actions.ts Resolved
Verified: npx tsx --test test/unit/*.test.ts, eslint, prettier, tsc
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.

3 participants