fix: keep restored receives silent - #1343
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
piotr-iohk
left a comment
There was a problem hiding this comment.
QA LGTM on 62774c0d.
No actionable code findings. Restore-tip silence looks correct vs iOS#588; Greptile/CodeQL threads verified at this head.
Migration @migration_1 green for RN v1.1.3 and v1.1.4 (the #1342 nightly failures). v1.1.6 @migration_1 re-run still in flight; prior fail attributed to #1258 (tracked, unrelated to this fix).
Fixes #1342
Related: synonymdev/bitkit-ios#588 (same fix on iOS)
This PR keeps a pre-restore on-chain receive confirmed within the last hour from showing a Received sheet after a mnemonic restore.
LDK events are handled in separate coroutines, so a replayed
OnchainTransactionConfirmedcould pass the restore-hold check after the first on-chain sync had already swept history and lifted the hold. The deposit's block time was inside the one-hour window, so the sheet showed and covered home.Description
SettingsData.restoreSyncedBlockHeight), in the same settings update that lifts the hold, so a historical confirmation stays silent however late its event is handled or a later rescan replays it.NotifyPaymentReceivedHandler, reading the hold and the tip from one settings snapshot so no check can see the hold lifted without the tip.NotifyPaymentReceived.Command.Onchain.restore-recent-receive-stays-silentjourney.Out of Scope
NotifyPaymentReceivedHandler: a reorg that replaces a block at or below the restore tip with one paying the wallet a tx it never saw in the mempool shows no sheet;SyncCompletedreports only a height, so the replacement block cannot be told apart. A tx seen in the mempool first still notifies.NotifyPaymentReceivedHandler: a genuinely new deposit that arrives while the first post-restore sync runs is still held; it notifies when it confirms, as long as that is within the hour. The first sync cannot tell it from an unconfirmed pre-restore transaction it replays.SettingsData.restoreSyncedBlockHeight: kept until the next restore. On a regtest chain reset with a persisted dev install, confirmed-only sheets stay silent until the new chain passes the old tip.Design
N/A — no UI changes.
Preview
N/A
QA Notes
Journeys
restore-recent-receive-stays-silent.xml— a deposit confirmed within the hour stays silent after restoring its seed, and a deposit mined after the restore still shows the sheetManual Tests
N/A
Automated Checks
NotifyPaymentReceivedHandlerTest.kt— a confirmed-only receive at or below the restore tip is skipped, and one above it shows the sheetWalletViewModelTest.kt— a failed restore releases the received-sheet holdSettingsStoreTest.kt— restoring settings from a backup keeps the restore tip recorded on this deviceAppViewModelSendFlowTest.kt— the first on-chain sync after a restore records its tip, and a failed sweep does notLightningNodeServiceTest.kt— confirmed commands carry the block height🤖 Generated with Claude Code