Skip to content

fix: wait for the fee rate before swipe to pay - #847

Draft
ovitrif wants to merge 4 commits into
masterfrom
fix/swipe-waits-for-fee-rate
Draft

ovitrif wants to merge 4 commits into
masterfrom
fix/swipe-waits-for-fee-rate

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #775

This PR keeps Swipe To Pay disabled until the fee rate has loaded.

Description

  • Keeps Swipe To Pay disabled, with the swipe's loading spinner, while an on-chain payment from the wallet has no fee rate yet, so a swipe can no longer fail with "Fee rate not set" while the fee-rate fetch is still running.
  • Resolves a missing fee rate at the start of the payment submit, before any warning, PIN check or Paykit payment proof, so a payment request is never consumed without a fee rate. This also covers the automatic payment path, which does not go through the swipe.
  • Lightning payments and hardware wallet sends keep their current rules: neither waits on the wallet fee rate.
  • Adds a changelog fragment.

Out of Scope

  • Bitkit/Views/Wallets/Send/SendSheet.swift: the fee-rate fetch itself (its timeout, error logging and when it runs) is unchanged; if the fetch fails for good the swipe stays disabled until the funding source is switched or the sheet is reopened.
  • Failed send leaving the payment request unpayable: fixed in fix: restore failed payment requests #826 (merged).
  • bitkit-android: not affected. Its on-chain send resolves its own fee rate at send time with a cached fallback, so no twin issue is needed.

Design

N/A — no design available. The swipe reuses its existing disabled and loading states.

Preview

QA Notes

Journeys

N/A — not drivable; see Manual Tests.

Manual Tests

  • Throttle the network so the Blocktank info request is slow → open a Paykit payment request or an on-chain invoice → Send confirmation from savings → the swipe is dimmed with a spinner and does not move; once the fee rate loads it becomes enabled and the payment goes through — network throttling not in Capabilities
  • regression: Lightning invoice → Send confirmation → the swipe is enabled immediately, without waiting for the fee rate — network throttling not in Capabilities

Automated Checks

  • added SendConfirmationSwipeTests.swift — on-chain payment without a fee rate disables the swipe, and it enables once a rate is set
  • added SendConfirmationSwipeTests.swift — Lightning and hardware payments never wait on the wallet fee rate

Swipe to pay on the send confirmation stays disabled and shows its loading state while an on-chain payment has no fee rate yet. submitPayment also resolves a missing fee rate before anything is consumed, so an automatic payment never starts without one.
@ovitrif ovitrif self-assigned this Sep 30, 2026
@ovitrif ovitrif changed the title fix: disable swipe to pay until the fee rate is loaded fix: wait for the fee rate before swipe to pay Sep 30, 2026
@ovitrif

ovitrif commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 9be9583: renamed the changelog fragment to this PR's number, as pr.md asks once the PR exists. No code change.

…o fix/swipe-waits-for-fee-rate

# Conflicts:
#	Bitkit/Views/Wallets/Send/SendConfirmationView.swift
@ovitrif

ovitrif commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed e3a17f3: merged master (it had #830 and #831 in SendConfirmationView.swift). Both sides' static helpers are kept; this PR's diff against master is unchanged. SendConfirmationSwipeTests 5/5, SendConfirmationViewTests 1/1 and PaykitPaymentRequestServiceTests 136/136 pass on an iPhone 17 simulator; SwiftFormat is clean.

…o fix/swipe-waits-for-fee-rate

# Conflicts:
#	Bitkit/Views/Wallets/Send/SendConfirmationView.swift
@ovitrif

ovitrif commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed dc31e10: merged master, which now has #826. Both sides' helpers in SendConfirmationView.swift are kept. The fee-rate guard stays at the start of submitPayment, before #826's requeue in performPayment, so a request is never consumed without a fee rate. SendConfirmationSwipeTests 5/5, SendConfirmationViewTests 4/4 (3 from #826), PaykitPaymentRequestServiceTests 146/146 and HwFundingSignerTests 31/31 pass; SwiftFormat is clean. Out of Scope now says #826 is merged.

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.

bug: swipe to pay is enabled before a fee rate is loaded and the send fails with "Fee rate not set"

1 participant