Skip to content

ios: no received transaction notification when tx confirms without being seen in mempool #455

@piotr-iohk

Description

@piotr-iohk

What happened?

When an on-chain transaction is sent to the wallet and a block is mined before the next LDK sync picks up the unconfirmed tx, the "received transaction" sheet/notification does not appear. The balance updates correctly and the activity list shows the transaction, but the user gets no visual feedback that funds arrived.

This happens because LDK Node only fires onchainTransactionConfirmed (skipping onchainTransactionReceived) when the tx goes straight to confirmed. The notification is only wired to the onchainTransactionReceived case in AppViewModel.swift, while onchainTransactionConfirmed only logs — it never checks whether the user was already notified.

Expected behavior

The "received transaction" sheet should appear whenever a new incoming on-chain transaction is detected, regardless of whether it was first seen in the mempool or directly as confirmed.

Steps to Reproduce

  1. Create a new wallet on regtest
  2. Copy the wallet's on-chain address
  3. Send BTC to that address from an external wallet (e.g. via bitcoin-cli)
  4. Immediately mine a block (before the app's next sync cycle)
  5. Observe: balance updates, activity list shows the tx, but no "received" notification/sheet appears

Logs / Screenshots / Recordings

Reproduced on iOS simulator. The system log confirms the same pattern as Android — the tx appears only as onchainTransactionConfirmed, with no prior onchainTransactionReceived event.

2026-02-20-missing-received-notification-logs.zip

Bitkit Version

master (d973871)

Device / OS

iPhone 17 Simulator, iOS 26.0

Reproducibility

Always

Additional context

  • New wallet on regtest
  • On-chain related
  • Environment: Regtest (network electrum)
  • On mainnet this is very unlikely because the ~10 min block interval gives periodic sync time to see the unconfirmed tx first, but it's theoretically possible if the app is backgrounded/offline during the brief window between broadcast and confirmation
  • The same issue exists on Android (filed separately)
  • Relevant code: AppViewModel.swift — the onchainTransactionConfirmed case (line ~828) only logs, while onchainTransactionReceived (lines ~805-827) shows the receivedTx sheet
  • Fix: the onchainTransactionConfirmed handler should also check whether the tx was already notified and, if not, show the received sheet
  • Same as android: no received transaction notification when tx confirms without being seen in mempool bitkit-android#797

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions