feat: add pending payment notifications#828
Open
ovitrif wants to merge 19 commits intofeat/send-pending-uifrom
Open
feat: add pending payment notifications#828ovitrif wants to merge 19 commits intofeat/send-pending-uifrom
ovitrif wants to merge 19 commits intofeat/send-pending-uifrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
app/src/main/java/to/bitkit/domain/commands/NotifyPendingPaymentResolvedHandler.kt
Outdated
Show resolved
Hide resolved
app/src/test/java/to/bitkit/ui/screens/wallets/send/SendPendingViewModelTest.kt
Show resolved
Hide resolved
app/src/test/java/to/bitkit/ui/screens/wallets/send/SendPendingViewModelTest.kt
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
app/src/main/java/to/bitkit/domain/commands/NotifyPendingPaymentResolvedHandler.kt
Show resolved
Hide resolved
app/src/test/java/to/bitkit/ui/screens/wallets/send/SendPendingViewModelTest.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/to/bitkit/domain/commands/NotifyPendingPaymentResolvedHandler.kt
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
9ed2ec3 to
5a3caa1
Compare
app/src/test/java/to/bitkit/ui/screens/wallets/send/SendPendingViewModelTest.kt
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
906e9b9 to
cbd8273
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cbd8273 to
be29098
Compare
app/src/main/java/to/bitkit/domain/commands/NotifyPendingPaymentResolved.kt
Show resolved
Hide resolved
app/src/main/java/to/bitkit/domain/commands/NotifyPendingPaymentResolved.kt
Show resolved
Hide resolved
app/src/test/java/to/bitkit/ui/screens/wallets/send/SendPendingViewModelTest.kt
Show resolved
Hide resolved
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.
This PR:
PendingPaymentRepofromLightningRepoto manage pending payment state independentlySendPendingViewModelby using resolution events directly from the repoDescription
When a Lightning payment is pending (e.g. hold invoices) and the user backgrounds the app, payment resolution events (success/failure) were silently ignored. This adds a CQRS command+handler (
NotifyPendingPaymentResolved) that checks whether a resolved payment was pending, and if the app is in the background, posts a system notification.The pending payment tracking logic has been extracted from
LightningRepointo a dedicatedPendingPaymentRepowith properStateFlow-based state management. TheSendPendingViewModelandQuickPayViewModelnow consume resolution events directly without mapping to intermediate types.Also:
Preview
bgnotifs_1.75x.mp4
Note
The regression issue with the error toast showing for the same cancelled pending payment handled by the sheet, as seen in the recording has been fixed in 27a378b
QA Notes
Setup
bitkit-docker:docker compose up -dcurl -sL https://gist.githubusercontent.com/ovitrif/ac13a7ba09efd4c12bee0a1b4cc27f4a/raw/local-electrum.patch | git applyUse
./bitcoin-cliinbitkit-dockerfor hold invoices:./bitcoin-cli holdinvoice 42 -m 'test' ./bitcoin-cli settleinvoice __preimage__ ./bitcoin-cli cancelinvoice __hash__Tests