Skip to content

feat: connection issues view#878

Open
jvsena42 wants to merge 25 commits intomasterfrom
feat/connection-issues-view
Open

feat: connection issues view#878
jvsena42 wants to merge 25 commits intomasterfrom
feat/connection-issues-view

Conversation

@jvsena42
Copy link
Copy Markdown
Member

@jvsena42 jvsena42 commented Mar 31, 2026

Related to #873

Description

This PR adds a reusable connection issues overlay view and improves network recovery behavior across multiple flows.

Connection Issues Overlay

  • Adds ConnectionIssuesView composable with phone illustration, dashed gradient rings, and a loading spinner
  • Integrates the overlay into SendSheet, ReceiveSheet, ForceTransferSheet, SpendingAmountScreen, SpendingConfirmScreen, and SavingsConfirmScreen using AnimatedVisibility
  • Auto-dismisses when connectivity is restored, preserving the underlying flow state

Network Recovery Improvements

  • LightningRepo.canSend() fallback: When channels are loading (node Starting or channels not yet usable after reconnect), falls back to cached totalLightningSats balance instead of returning false — fixes unified invoices only showing savings option after reconnecting
  • SpendingAmountScreen refresh: Re-triggers updateLimits() when connectivity state changes, so the "Available" field updates after coming back online
  • IsOnlineTracker fix: Fixed isFirstEmission flag never being set to false, which prevented connectivity toasts from ever appearing
  • LightningRepo.awaitPeerConnected(): New method that polls for peer reconnection (up to 30s) before attempting cooperative channel close — prevents "Cannot begin shutdown while peer is disconnected" errors during transfer to savings after internet toggle
  • TransferViewModel.closeChannels(): Calls awaitPeerConnected() before attempting cooperative close, reducing unnecessary INTERRUPTED state in the savings progress screen

Preview

transfer-to-spending.webm
receive-sheet.webm
send-sheet.webm
transfer-to-savings.webm

QA Notes

Connection Issues Overlay

  1. Open the Send Bitcoin sheet, toggle airplane mode on
    • Connection Issues overlay should fade in over the send flow
    • Title should read "Send Bitcoin"
    • Dashed yellow rings and phone illustration should be visible
    • Spinner should be animating at the bottom
  2. Re-enable connectivity
    • Overlay should fade out
    • Send flow state should be preserved (no navigation reset)
  3. Repeat for Receive Bitcoin sheet (title: "Receive Bitcoin")
  4. Repeat for Force Transfer sheet (title: "Transfer Funds")
  5. Repeat for Transfer to Spending screens (amount + confirm)
  6. Repeat for Transfer to Savings confirm screen
  7. Verify the overlay does not appear when connectivity is stable

Network Recovery — Send Flow

  1. With on-chain + lightning balance, enable airplane mode → open send sheet → disable airplane mode → paste unified zero-amount invoice
    • Both savings AND spending options should appear (not just savings)

Network Recovery — Transfer to Savings

  1. Toggle airplane mode off/on → immediately confirm transfer to savings
    • Progress screen should wait for peer reconnection and show SUCCESS (not INTERRUPTED)
    • Check logs for "Waiting for peer to reconnect" message

Connectivity Toasts

  1. Toggle airplane mode on → "Internet Connectivity Issues" warning toast should appear
  2. Toggle airplane mode off → "Internet Connection Restored" success toast should appear

@jvsena42 jvsena42 self-assigned this Mar 31, 2026
@jvsena42 jvsena42 marked this pull request as ready for review April 2, 2026 14:10
@jvsena42 jvsena42 added this to the 2.2.0 milestone Apr 2, 2026
@claude

This comment has been minimized.

@claude

This comment has been minimized.

jvsena42 and others added 3 commits April 2, 2026 13:25
Base automatically changed from feat/send-v60 to master April 2, 2026 18:14
@jvsena42
Copy link
Copy Markdown
Member Author

jvsena42 commented Apr 3, 2026

@piotr-iohk I suppose there is a missing update in a test flow, because of the detail button

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