feat: connection issues view#878
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
4 tasks
# Conflicts: # app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt # app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt # app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt
ovitrif
previously approved these changes
May 7, 2026
Collaborator
ovitrif
left a comment
There was a problem hiding this comment.
LGTM
Tested all cases.
had to merge manually then fix a few issues, then I smoke retested send (which was initially broken by manual merge).
…-view # Conflicts: # app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
fix: stabilize send scan routing
ovitrif
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #873
Description
This PR adds a reusable connection issues overlay view and improves network recovery behavior across multiple flows.
Connection Issues Overlay
ConnectionIssuesViewcomposable with phone illustration, dashed gradient rings, and a loading spinnerAnimatedVisibilitycanSendRefactor — Replace Cache with Flow-Based StatecanSend()no longer falls back to stale cached balance from DataStore when channels aren't usable — prevents false-positive unified invoices that would fail at payment timecanSend()is now a non-suspend function that checks_lightningState.value.channelscapacity directlywaitForUsableChannels()made public: Callers that need to wait for channel readiness (scan flows) call it explicitly beforecanSend()LightningService.canSend(): Logic inlined viatotalNextOutboundHtlcLimitSats()extension on reactive statecachedLightningBalance(),CHANNELS_READY_TIMEOUT_MSSyncNodeView on SendSheet
SyncNodeViewoverlay on SendSheet when node is not running or lightning channels aren't usable yet (matching iOSshouldShowSyncOverlaybehavior)Network Recovery Improvements
SpendingAmountScreenrefresh: Re-triggersupdateLimits()when connectivity state changes, so the "Available" field updates after coming back onlineIsOnlineTrackerfix: FixedisFirstEmissionflag never being set tofalse, which prevented connectivity toasts from ever appearingLightningRepo.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 toggleTransferViewModel.closeChannels(): CallsawaitPeerConnected()before attempting cooperative close, reducing unnecessary INTERRUPTED state in the savings progress screenPreview
send-sheet-sync-view.webm
deeplink-and-quickpay.webm
receive-sheet.webm
transfer-to-savings.webm
transfer-to-spending.webm
scan-sheet-zero-amount.webm
scan-sheet-with-amount.webm
scan-sheet-sync-view.webm
send-sheet-zero-amount.webm
send-sheet-with-amount.webm
QA Notes
Connection Issues Overlay
canSend / SyncNodeView
With node starting, open send sheet → SyncNodeView overlay should show
Paste BIP21 unified invoice while node is starting
With node running and channels usable, paste BIP21 → should show both savings and spending options
Network Recovery — Send Flow
Network Recovery — Transfer to Savings
Connectivity Toasts