Skip to content

Conversation

@pwltr
Copy link
Contributor

@pwltr pwltr commented Jan 23, 2026

Description

  • show a “Syncing Node” overlay when opening Send if the node is not running yet
  • defer validation checks until after sync

Linked Issues/Tasks

Closes #339

Screenshot / Video

Unified invoice:

Simulator.Screen.Recording.-.iPhone.17.-.2026-01-16.at.01.00.09.mov

QuickPay (deeplink):

Simulator.Screen.Recording.-.iPhone.17.-.2026-01-16.at.01.00.09.mov

QA Notes

Use a deeplink like

xcrun simctl openurl "iPhone 17" "bitcoin:bcrt1qmd722klk04yph86ky8jz9gvj6g8n9kjep9zj7d?amount=0.0000002&lightning=LNBCRT200N1P5H8H4HDQQNP4QDRM0Y4AT84E48QVDN8CSWVE204SF6FFRR3W3AK904GE3JSEGLP4GPP5VCSLQ6RPA2RHQJ40LG6ELHE4JA0548TNQZTX4UFSTKAJ8FAHKLASSP5E2EQTTN20PF2HV7EZQCDKY43DSCVLXXR5LC6E920GDR3GXJ0QYSQ9QYYSGQCQPCXQRRSSRZJQ29GJY9SQJRRP48TZ7HJ2E5VM4L2DUKC4CSF2MN6QM32U3HTED5LEAPYQQQQQQQF95QQQQLGQQQQQQGQ2Q9T08YP2026U697073LS2FRT0EY9MKEYQASUTM5DV9KV5FZS5X2UPPHLFYU4C3Q34LJ8GRTLQ2YG0SWPZJMSK74MV6WHWUEZWG870AHCQGD3XDW"

@pwltr pwltr marked this pull request as ready for review January 26, 2026 09:18
@pwltr pwltr force-pushed the feat/node-connecting-ui branch from 08d95b0 to 9555fd1 Compare January 26, 2026 09:21
@claude

This comment has been minimized.

@claude

This comment has been minimized.

@piotr-iohk
Copy link
Collaborator

There seems to be a regression (from e2e send_2):

  • sending unified invoice with onchain = 20 000 and lightning = 200 000 sats: bitcoin:bcrt1qrj2dcxqv2vm2mm94h6lpp6hgnp6hglfxadherq?amount=0.0002&lightning=lnbcrt2m1p5h03d0pp5sjdqh2xylewme5n3gwv9wqa3ua8v8x8esu9td4t4aee5azemgjmqdqqcqzzsxqyz5vqsp5ax0t68lz5fcrnz73rt439hg7sawfys8xlwfw9m6csmchy8dru77q9qxpqysgqddmkhflxt25kugzucn7jjxkqp6jkg9gjsjpyudysadv62ad3cfk3h4t7l4mzr92fnlywdn7vkxhckv7fffagrendvv00fqr9rc6x30gql76ghh
  • should trigger tx from savings since balance on lightning exceeded.
Screen.Recording.2026-01-26.at.20.59.54.mov

@jvsena42

This comment was marked as outdated.

@pwltr pwltr marked this pull request as draft January 27, 2026 15:00
@pwltr pwltr force-pushed the feat/node-connecting-ui branch from 5ae4524 to a15fef5 Compare January 28, 2026 10:54
@pwltr pwltr marked this pull request as ready for review January 28, 2026 10:55
@pwltr pwltr force-pushed the feat/node-connecting-ui branch from 1b79730 to a4f98bf Compare January 28, 2026 11:01
@pwltr
Copy link
Contributor Author

pwltr commented Jan 28, 2026

Updated and tested against Docs/SCAN_INVOICE_TEST_MATRIX.md

@pwltr pwltr requested a review from ben-kaufman January 28, 2026 11:04
@pwltr pwltr linked an issue Jan 28, 2026 that may be closed by this pull request
@pwltr
Copy link
Contributor Author

pwltr commented Jan 28, 2026

@piotr-iohk Could you run e2e for this locally, please? Also note the test matrix in Docs/SCAN_INVOICE_TEST_MATRIX.md, would be nice if any missing test cases could be added from there too.

@piotr-iohk
Copy link
Collaborator

@piotr-iohk Could you run e2e for this locally, please? Also note the test matrix in Docs/SCAN_INVOICE_TEST_MATRIX.md, would be nice if any missing test cases could be added from there too.

CI E2E unblocked, but passed locally for me in the meantime. I will update e2e with missing cases (currently ~60% covered).

jvsena42
jvsena42 previously approved these changes Jan 28, 2026
Copy link
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

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

tAck

Copy link
Collaborator

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

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

tACK

piotr-iohk
piotr-iohk previously approved these changes Jan 28, 2026
@pwltr
Copy link
Contributor Author

pwltr commented Jan 28, 2026

Found a small bug, patching...

@pwltr pwltr dismissed stale reviews from piotr-iohk and jvsena42 via 46140ea January 28, 2026 15:07
@pwltr pwltr requested review from jvsena42 and piotr-iohk January 28, 2026 15:08
@claude

This comment has been minimized.

@pwltr pwltr force-pushed the feat/node-connecting-ui branch from 46140ea to 0c629c2 Compare January 28, 2026 15:19
@pwltr pwltr force-pushed the feat/node-connecting-ui branch from 0c629c2 to ed94cf7 Compare January 28, 2026 15:20
@claude
Copy link

claude bot commented Jan 28, 2026

Code review

After reviewing this PR for bugs and CLAUDE.md compliance, I found one issue:


Potential infinite wait state in SendSheet.swift

Location: Bitkit/Views/Wallets/Send/SendSheet.swift lines 197-200

Issue: If Lightning channels exist but never become usable (e.g., peer permanently offline, stuck channel state), users will be trapped in the sync overlay indefinitely with no escape.

The early return at lines 197-200 exits without setting hasValidatedAfterSync = true. The onChange(of: wallet.hasUsableChannels) handler only fires when the value changes. If channels remain permanently unusable, the validation never completes and the user cannot dismiss the sync overlay or proceed.

Suggested fix: Add a timeout mechanism or fallback logic:

// Option 1: Add timeout state
@State private var syncStartTime: Date?

// In .onAppear or when showing overlay:
syncStartTime = Date()

// In validatePaymentAfterSync:
let syncDuration = Date().timeIntervalSince(syncStartTime ?? Date())
if hasAnyChannels, !wallet.hasUsableChannels {
    if syncDuration > 30 { // 30 second timeout
        // Fall back to onchain or show "channels unavailable" error
        hasValidatedAfterSync = true
        // Proceed with validation or dismiss
    } else {
        return
    }
}

Or add a manual dismiss option in the sync overlay UI so users aren't trapped if something goes wrong.

@pwltr
Copy link
Contributor Author

pwltr commented Jan 28, 2026

Can I get another review please @piotr-iohk @jvsena42, I appended a bug fix

@piotr-iohk
Copy link
Collaborator

@pwltr is this looks like something that needs to be addressed? #401 (comment)

@pwltr
Copy link
Contributor Author

pwltr commented Jan 29, 2026

@pwltr is this looks like something that needs to be addressed? #401 (comment)

The comment is about channels never becoming usable, in that case the user will not be able to send any payments anyway. Can think about showing an error state but I'd consider that polishing for later.

Copy link
Collaborator

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

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

LGTM, sanity tested with deeplinks.

@pwltr pwltr merged commit a421d97 into master Jan 29, 2026
9 checks passed
@pwltr pwltr deleted the feat/node-connecting-ui branch January 29, 2026 10:40
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.

Occasional "Node is not setup" when sending lightning payment [BUG] "Lightning not running" when paying quickly

5 participants