Skip to content

test: handle the move to spark intro - #297

Open
ovitrif wants to merge 6 commits into
mainfrom
feat/move-to-spark
Open

ovitrif wants to merge 6 commits into
mainfrom
feat/move-to-spark

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Companion:

Description

The apps now show a one-time Move to Spark intro, at the top timed-sheet priority, once a wallet's Lightning channels can move a balance to a ready Spark wallet. That turns true on state a test cannot see (a receive, Spark connecting), so the intro can cover home at any step of a suite that opens a channel and receives over it.

  • Adds dismissMoveToSparkIntroIfShown(), which taps Later, and withMoveToSparkIntroRecovery(), which retries a failed wait once after dismissing the intro, as the ANR recovery does for system dialogs.
  • tap, the received-payment wait and the HeaderMenu wait in doTriggerTimedSheet recover through it, and acknowledgeReceivedPayment dismisses the intro if it shows within 3 s, ahead of balance reads.
  • The timed-sheet trigger treats the intro as an intervening sheet, as it does the USDT intro: after dismissing it, it lets home surface the next queued sheet instead of triggering over it.
  • The probe is MoveToSparkIntroLater, queryable on both platforms.

On synonymdev/bitkit-android#1774, without this branch, lightning_security, lnurl_transfer, multi_address_local and send failed with the intro covering home (@lightning_1, @lnurl_1, @transfer_2, @multi_address_4, @send_2).

QA Notes

@ovitrif ovitrif self-assigned this Nov 6, 2026
@ovitrif
ovitrif requested review from a team, coreyphillips and pwltr and removed request for a team November 6, 2026 18:44
@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T18:45:47.855687Z c436191 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.

No findings. Teaches the timed-sheet helpers to dismiss the new Move to Spark intro with Later, as they already do the USDT intro, and to re-trigger the queue when it surfaces in place of the expected sheet. Reviewed c436191, full tier, static.

What I checked, and 5 candidates I ruled out

Read in full: test/helpers/actions.ts (triggerTimedSheetUnlessPresent, dismissInterveningSheets, dismissMoveToSparkIntroIfShown, waitForWalletHome, restoreWallet, completeOnboarding), test/helpers/navigation.ts (doTriggerTimedSheet), test/specs/transfer.e2e.ts (dismissHomeSheetsIfPresent, @transfer_1, @transfer_2), and the call sites in lightning, lnurl, send and multiaddress.
Cross-repo contract: the ids MoveToSparkIntro and MoveToSparkIntroLater match the sheet in synonymdev/bitkit-android#1774 (MoveToSparkSheet.kt testTags) and synonymdev/bitkit-ios#1212 (MoveToSparkSheet.swift accessibility identifiers). On Android the sheet is MOVE_TO_SPARK(priority = 7), above every other timed sheet, and onShown sets hasSeenMoveToSparkIntro, so the extra doTriggerTimedSheet() after a dismiss cannot bring the intro back.
CI: this repo reports no checks on the branch. The failure the PR targets is real: the bitkit-android#1774 E2E run before this branch existed failed @lightning_1 on TotalBalance-primary right after BackgroundPaymentsIntro-later not displayed. The app PRs' E2E runs that pick this branch up by name were still in progress when I looked.
Build skipped: talos-pr-run could not check the author's permission on this repo and fails closed, so nothing was run here; tsc, eslint and prettier are the author's report.

Ruled out

  • triggerTimedSheet: false callers now trigger the queue: dismissInterveningSheets() runs before the early return, but it triggers only after it dismissed an intervening sheet, which is what the USDT branch already did.
  • Intro surfacing more than 3 s after the final trigger: the earlier checks wait for home chrome and settle 700 ms around two dismiss passes before the trigger; a later surfacing needs the sheet manager to delay past that, which I could not show from the app code.
  • dismissHomeSheetsIfPresent in transfer.e2e.ts does not know the intro: @transfer_1 is skipped, and @transfer_2 goes through dismissBackgroundPaymentsTimedSheet, which now handles it.
  • Intro after restoreWallet in @lightning_1: whether it reappears depends on whether the restored settings backup carries hasSeenMoveToSparkIntro, which I could not establish statically; the companion E2E run decides it.
  • waitForWalletHome and completeOnboarding do not wait for the intro: a fresh wallet has no channel, and canMove needs at least 1,000 sats sendable over a channel, so it cannot show there.

Merge confidence: 4/5, no findings, but nothing exercised this head yet: the companion E2E runs that do were still in progress.

@ovitrif

ovitrif commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed ec5958c, from the first run on synonymdev/bitkit-android#1774:

  • After the Move to Spark intro is dismissed, home re-checks the queue about 2 s later and surfaces the next sheet by itself (QuickPay in @multi_address_4), which covered HeaderMenu before the helper could re-trigger. The helpers now wait for the expected sheet first and trigger only when it does not come.
  • The QuickPay and Background Payments dismiss helpers wait briefly for the intro afterwards (@lightning_1, @send_2), since it needs a Lightning balance as they do.

Re-running the failed Android e2e jobs against this head.

@ovitrif

ovitrif commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed e2030ac and 70d01c1, from the second run on synonymdev/bitkit-android#1774:

  • The intro surfaced more than 4 s after QuickPay closed (@send_2, @lightning_1), so the QuickPay and Background Payments helpers now wait up to 10 s for it.
  • After the intro is dismissed, the next queued sheet can be QuickPay rather than the Background Payments sheet the caller expects (@multi_address_4, @lnurl_1); the trigger helper now stops there, leaving the best-effort Background Payments wait and the following QuickPay helper to handle it.

Re-running the failed Android e2e jobs against 70d01c1.

@ovitrif

ovitrif commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed b004e5e. The third run on synonymdev/bitkit-android#1774 showed the intro becomes due on state a test cannot see: in @lightning_1 it was not due at the trigger right after QuickPay and showed after the next receive. So instead of waiting at fixed points:

  • tap, the received-payment wait and the HeaderMenu wait in doTriggerTimedSheet recover from it as they would from the ANR dialog: when the wait fails and the intro is showing, tap Later and retry once.
  • acknowledgeReceivedPayment dismisses it if it shows within 3 s, ahead of balance reads.
  • The probe is MoveToSparkIntroLater, queryable on both platforms.
  • The forced trigger after QuickPay is gone.

Re-running the whole Android e2e workflow against b004e5e.

@ovitrif
ovitrif requested review from piotr-iohk and removed request for coreyphillips and pwltr November 6, 2026 23:51
@ovitrif

ovitrif commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

Proven on synonymdev/bitkit-android#1774 at 95fe19287: all 7 e2e shards pass against b004e5e (https://github.com/synonymdev/bitkit-android/actions/runs/42309414918), and the helper dismissed the Move to Spark intro in each suite that meets it (lightning_security, send, multi_address_local, lnurl_transfer).

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