Skip to content

fix: prevent cleared Bolt11 invoices from appearing in transaction history#111

Open
Delgado74 wants to merge 7 commits into
lachispame:mainfrom
Delgado74:fix/clear-invoice-removes-from-history
Open

fix: prevent cleared Bolt11 invoices from appearing in transaction history#111
Delgado74 wants to merge 7 commits into
lachispame:mainfrom
Delgado74:fix/clear-invoice-removes-from-history

Conversation

@Delgado74

@Delgado74 Delgado74 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #107. When a user generates a Bolt11 invoice from the receive screen and clears it (via the "Clear invoice" button, 10-minute timeout, or navigating away), the invoice should not appear in the transaction history. Previously, it remained visible because the invoice was only removed from local UI state without any cancellation on the LNBits server or local record of the cleared invoice.

Also closes #112: users can now manually clear pending invoices from the history screen itself, either by swiping on pending transaction cards or via a "Clear from history" button in the transaction detail bottom sheet.

Changes

Why additional modifications were needed beyond issue #107 proposals

The original issue proposed four options (A-D), with Option D (hybrid: server cancel + local filtering) as the recommended approach. During implementation, three additional problems were discovered that required going beyond the original proposal:

  1. **Race condition in **: The original Option D added the payment hash to the cleared set only inside the async method — AFTER an HTTP call to LNBits. If the user navigated to the history screen before this async operation completed, the hash wasn't in the set yet, and the invoice appeared.

  2. Timeout and dispose were not covered: The 10-minute invoice monitoring timeout handler and the widget's method (when the user navigates away) both cleared locally but never recorded the hash anywhere. These paths left pending invoices visible in history.

  3. No persistence across app restarts: The original proposals only kept the cleared hashes in an in-memory . If the app was closed and reopened (or crashed), the set was empty and ALL previously cleared invoices reappeared in history.

To solve all three, we added:

  • **** (lib/services/cleared_invoice_store.dart): a singleton that persists cleared payment hashes to as JSON, surviving app restarts and crashes.
  • **** (9receive_screen.dart): a synchronous helper that records the hash to the persistent store before any async operation. Used by all three discard paths (clear button, timeout, dispose).
  • Hash recorded synchronously: In , the hash is added to ClearedInvoiceStore.instance BEFORE the async call. This eliminates the race condition entirely.

New: Clear pending invoices from history (#112)

  • Swipe-to-dismiss: pending transaction cards can be swiped left or right. A confirmation dialog appears, and on confirmation the invoice is cleared from history.
  • Button in detail bottom sheet: tapping a pending transaction shows a "Clear from history" button at the bottom of the details modal.
  • Both paths add the payment hash to ClearedInvoiceStore and attempt server-side cancellation via InvoiceService.cancelInvoice().
  • New localization strings added to all 7 supported locales (de, en, es, fr, it, pt, ru).

lib/services/cleared_invoice_store.dart

NEW FILE — Singleton that persists cleared payment hashes to SharedPreferences as JSON.

lib/services/invoice_service.dart

  • Added cancelInvoice() method that attempts DELETE /api/v1/payments/{paymentHash} on multiple LNBits API endpoints

lib/screens/9receive_screen.dart

  • Added import and usage of ClearedInvoiceStore
  • _clearInvoice(), _discardInvoice(), and dispose() now record the payment hash to ClearedInvoiceStore before attempting server cancellation
  • Added _tryCancelInvoiceOnServer() helper

lib/screens/7history_screen.dart

  • _filteredTransactions excludes pending transactions whose paymentHash is in ClearedInvoiceStore
  • Added _doClearPendingTransaction() and _clearPendingTransaction() methods
  • Added _tryCancelInvoiceOnServer() helper
  • Added swipe-to-dismiss (Dismissible) on pending transaction cards
  • Added "Clear from history" ElevatedButton in the detail bottom sheet

lib/main.dart

  • ClearedInvoiceStore.instance.load() called before runApp()

lib/l10n/

  • New keys in all locale ARB files:
    • clear_pending_invoice
    • clear_pending_confirm_title
    • clear_pending_confirm_message
    • invoice_cleared_from_history

Hybrid approach (Option D from issue)

  1. Try to cancel the invoice on the LNBits server via DELETE endpoint
  2. If server doesn't support cancellation, add the payment hash to a local set and filter it from history display

Summary by CodeRabbit

  • New Features

    • Users can now remove pending invoices from transaction history through an intuitive swipe action or dedicated button in transaction details
    • A confirmation dialog safeguards against accidental removal
  • Internationalization

    • Added localization support for the new clearing feature in German, Spanish, French, Italian, Portuguese, and Russian

Review Change Stack

Delgado74 added 2 commits May 12, 2026 11:34
…g transactions

When a user generates a Bolt11 invoice from the receive screen and
presses 'Clear invoice', the invoice remained visible in the transaction
history because _clearInvoice() only cleared local UI state without
cancelling the pending invoice on the LNBits server.

Add cancelInvoice() method to InvoiceService that attempts DELETE on
LNBits API endpoints. If the server does not support cancellation, the
payment hash is stored in a shared set and filtered from the history
screen locally.
…story

When a user generated a Bolt11 invoice on the receive screen and then
pressed 'Clear invoice', or when the 10-minute monitoring timeout
expired, or when navigating away, the invoice remained visible in the
transaction history. This happened because the invoice was only removed
from local UI state but was never cancelled on the LNBits server, and
no local record of the cleared invoice was kept.

Key changes:
- Add cancelInvoice() to InvoiceService: attempts DELETE on LNBits
  API endpoints to cancel the pending invoice server-side
- Add ClearedInvoiceStore: persists cleared invoice payment hashes
  to SharedPreferences as JSON, surviving app restarts and crashes
- Add _discardInvoice() helper: used by both clear and timeout paths
  to ensure the hash is always recorded before async cancellation
- Update HistoryScreen filter: excludes pending transactions whose
  payment hash is in the cleared set

All discard paths (_clearInvoice, timeout, dispose) now record the
hash synchronously before async cancellation is attempted, eliminating
race conditions between clearing and history navigation.
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Delgado74, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 19 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 926bf56e-d924-40af-b8b0-f98cbb65a168

📥 Commits

Reviewing files that changed from the base of the PR and between 5b8c8b0 and a7db20d.

⛔ Files ignored due to path filters (8)
  • lib/l10n/generated/app_localizations.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_de.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_en.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_es.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_fr.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_it.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_pt.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_ru.dart is excluded by !**/generated/**
📒 Files selected for processing (9)
  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_pt.arb
  • lib/l10n/app_ru.arb
  • lib/screens/7history_screen.dart
  • lib/screens/9receive_screen.dart
📝 Walkthrough

Walkthrough

Adds a persisted ClearedInvoiceStore, loads it at app startup, records cleared/discarded invoice hashes from ReceiveScreen (and attempts server cancellation), and filters those hashes out of HistoryScreen results.

Changes

Cleared Invoice Tracking and Cancellation

Layer / File(s) Summary
Cleared invoice store implementation
lib/services/cleared_invoice_store.dart
New singleton service persisting cleared invoice hashes using shared_preferences. Provides load(), add(hash), contains(hash), and all.
App startup initialization
lib/main.dart
Loads ClearedInvoiceStore at startup with await ClearedInvoiceStore.instance.load() before runApp().
Invoice cancellation API
lib/services/invoice_service.dart
New cancelInvoice(serverUrl, adminKey, paymentHash) attempts DELETE against LNBits endpoints and returns success (200/204) or failure.
ReceiveScreen invoice tracking and cancellation
lib/screens/9receive_screen.dart
Records generated invoice paymentHash into ClearedInvoiceStore on clear, discard (timeout), and dispose; cancels local timers and starts async server cancellation via _tryCancelInvoiceOnServer().
HistoryScreen cleared invoice filtering & actions
lib/screens/7history_screen.dart
Filters out pending transactions whose paymentHash is present in ClearedInvoiceStore; adds swipe-to-dismiss and details-button flows that confirm, record the hash, and attempt server cancellation.
Localization updates
lib/l10n/*.arb
Adds localized UI strings for clearing a pending invoice from history across multiple locales and updates English qr_scanner_instructions.

Sequence Diagram

sequenceDiagram
  participant User
  participant ReceiveScreen
  participant HistoryScreen
  participant ClearedInvoiceStore
  participant InvoiceService
  participant LNBits
  User->>ReceiveScreen: Generate invoice
  ReceiveScreen->>ReceiveScreen: set _generatedInvoice
  User->>ReceiveScreen: Clear / Discard / Timeout
  ReceiveScreen->>ClearedInvoiceStore: add(paymentHash)
  ReceiveScreen->>InvoiceService: _tryCancelInvoiceOnServer(paymentHash) (async)
  InvoiceService->>LNBits: DELETE /api/v1/payments/{paymentHash}
  alt Server cancellation succeeds
    LNBits-->>InvoiceService: 200/204
  else Server cancellation fails
    InvoiceService->>LNBits: DELETE /api/v1/wallet/payment/{paymentHash}
  end
  User->>HistoryScreen: View transaction history
  HistoryScreen->>ClearedInvoiceStore: contains(paymentHash)?
  ClearedInvoiceStore-->>HistoryScreen: exclude from display
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • lachispame/lachispa#85: Receive-screen invoice generation and clear/timeout handling intersect with this PR's invoice tracking and cancellation logic.
  • lachispame/lachispa#84: History screen transaction-details UI changes overlap with this PR's "clear pending invoice" actions.

Poem

🐰 I nibble hashes, tuck them tight,

Saved in burrows out of sight,
Cleared from lists, the ledger sleeps,
No ghost invoices in my keeps,
A hop, a thunk, the history's light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: preventing cleared Bolt11 invoices from appearing in transaction history, which is the primary objective of this PR.
Linked Issues check ✅ Passed All requirements from issues #107 and #112 are met: ClearedInvoiceStore persists cleared hashes, InvoiceService.cancelInvoice() attempts server cancellation, ReceiveScreen records hashes synchronously before async ops, HistoryScreen filters and allows clearing from list/detail sheet, and all paths (clear, timeout, dispose) are covered.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing issue #107 and implementing feature #112: new ClearedInvoiceStore service, updates to InvoiceService, changes to ReceiveScreen and HistoryScreen logic, and localization strings for the new UI. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/screens/9receive_screen.dart`:
- Around line 129-131: The discard/dispose paths currently only record cleared
invoices locally via
ClearedInvoiceStore.instance.add(_generatedInvoice!.paymentHash) (seen where
_generatedInvoice is handled) but do not attempt server cancellation; update
those paths (the discard and dispose flows that call
ClearedInvoiceStore.instance.add and any similar local-only branches) to also
fire a best-effort, unawaited cancellation by calling
unawaited(_tryCancelInvoiceOnServer(hash)) with the same payment hash (e.g., use
_generatedInvoice!.paymentHash or the local hash variable) so the upstream
pending invoice is best-effort cancelled while preserving the existing local
recording.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6886fec3-b482-4f11-9b19-6de8f9e4abec

📥 Commits

Reviewing files that changed from the base of the PR and between ac3e168 and 5646db6.

📒 Files selected for processing (5)
  • lib/main.dart
  • lib/screens/7history_screen.dart
  • lib/screens/9receive_screen.dart
  • lib/services/cleared_invoice_store.dart
  • lib/services/invoice_service.dart

CodeRabbit review found that _discardInvoice() and dispose() only
recorded the cleared invoice hash locally but did not fire a best-effort
server cancellation. This could leave pending invoices active on LNBits
even when the user navigated away or the monitoring timeout fired.

Add unawaited(_tryCancelInvoiceOnServer(hash)) to both paths so the
DELETE attempt is always made regardless of how the invoice is discarded.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/screens/9receive_screen.dart (1)

122-136: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

context.read from dispose() is unsafe and wallet.inKey is the wrong credential for server cancellation.

The call to _tryCancelInvoiceOnServer from dispose() (line 133) invokes context.read<WalletProvider>() and context.read<AuthProvider>() (lines 824–825), which is unsafe during widget teardown. Per Flutter provider documentation, this can throw "Looking up a deactivated widget's ancestor is unsafe," and the error will be silently swallowed by the empty catch (_) at line 836, leaving invoices un-cancelled with no signal.

Additionally, the method passes wallet.inKey as the adminKey parameter to cancelInvoice() (line 828). Since WalletInfo has both adminKey and inKey fields, and only the admin key can perform DELETE operations on the LNBits API, this will fail to cancel invoices on the server. This same bug appears in createInvoice() and checkInvoiceStatus() calls.

Fix: Cache serverUrl, wallet, and auth data after invoice generation into _State fields and pass them directly to _tryCancelInvoiceOnServer instead of resolving from context. Use wallet.adminKey instead of wallet.inKey for all server operations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/screens/9receive_screen.dart` around lines 122 - 136, The dispose() call
is unsafe because _tryCancelInvoiceOnServer currently resolves
WalletProvider/AuthProvider from context and uses wallet.inKey; change the flow
to cache serverUrl, WalletInfo, and auth credentials into State fields when you
generate the invoice (e.g., where _generatedInvoice is set), then have dispose()
call unawaited(_tryCancelInvoiceOnServer(cachedServerUrl, cachedWallet,
cachedAuth, ...)) using those cached fields; also update all server calls
(createInvoice(), checkInvoiceStatus(), _tryCancelInvoiceOnServer) to use
wallet.adminKey instead of wallet.inKey so DELETE/auth operations use the admin
credential. Ensure _tryCancelInvoiceOnServer signature and calls are updated to
accept the cached values rather than reading from context.
🧹 Nitpick comments (1)
lib/screens/9receive_screen.dart (1)

790-820: ⚡ Quick win

De-duplicate _clearInvoice and _discardInvoice.

The bodies are identical except for the trailing snackbar. Have _clearInvoice delegate to _discardInvoice and then show the snackbar — keeps the cleanup/recording logic in one place so future tweaks (e.g., capturing the server credentials suggested above) only need to land once.

♻️ Proposed refactor
   void _clearInvoice() {
-    _invoicePaymentTimer?.cancel();
-    _invoicePaymentTimeoutTimer?.cancel();
-
-    if (_generatedInvoice != null) {
-      final hash = _generatedInvoice!.paymentHash;
-      ClearedInvoiceStore.instance.add(hash);
-      unawaited(_tryCancelInvoiceOnServer(hash));
-    }
-
-    setState(() {
-      _generatedInvoice = null;
-    });
+    _discardInvoice();
     _showAccentSnackBar(
       icon: Icons.check_circle,
       message: AppLocalizations.of(context)!.invoice_cleared_message,
     );
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/screens/9receive_screen.dart` around lines 790 - 820, Refactor to remove
duplicate cleanup logic by making _discardInvoice contain the shared
cancellation/clearing/recording logic (cancel _invoicePaymentTimer and
_invoicePaymentTimeoutTimer, add paymentHash to ClearedInvoiceStore, call
unawaited(_tryCancelInvoiceOnServer(hash)), and setState to clear
_generatedInvoice), then have _clearInvoice simply call _discardInvoice() and
afterwards call _showAccentSnackBar(...) to display the success message; update
references to paymentHash, ClearedInvoiceStore.instance,
_tryCancelInvoiceOnServer, and setState in those functions to ensure behavior is
identical after delegating.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/screens/9receive_screen.dart`:
- Around line 130-134: The call to ClearedInvoiceStore.instance.add(hash)
returns a Future and must be wrapped with unawaited(...) to avoid dropping the
Future and to match the surrounding pattern (_tryCancelInvoiceOnServer is
already unawaited); replace direct calls to
ClearedInvoiceStore.instance.add(hash) with
unawaited(ClearedInvoiceStore.instance.add(hash)) at all three call sites in
this file (the branch guarded by _generatedInvoice != null and the other two
occurrences referenced in the review) so persistence I/O errors are not silently
discarded.
- Around line 822-837: In _tryCancelInvoiceOnServer replace the read-only
invoice key with the wallet's admin key when calling
InvoiceService.cancelInvoice: pass wallet.adminKey (not wallet.inKey) as the
adminKey argument to ensure the LNBits DELETE endpoint is authorized; locate the
call to cancelInvoice inside _tryCancelInvoiceOnServer and update the adminKey
parameter to use wallet.adminKey.

---

Outside diff comments:
In `@lib/screens/9receive_screen.dart`:
- Around line 122-136: The dispose() call is unsafe because
_tryCancelInvoiceOnServer currently resolves WalletProvider/AuthProvider from
context and uses wallet.inKey; change the flow to cache serverUrl, WalletInfo,
and auth credentials into State fields when you generate the invoice (e.g.,
where _generatedInvoice is set), then have dispose() call
unawaited(_tryCancelInvoiceOnServer(cachedServerUrl, cachedWallet, cachedAuth,
...)) using those cached fields; also update all server calls (createInvoice(),
checkInvoiceStatus(), _tryCancelInvoiceOnServer) to use wallet.adminKey instead
of wallet.inKey so DELETE/auth operations use the admin credential. Ensure
_tryCancelInvoiceOnServer signature and calls are updated to accept the cached
values rather than reading from context.

---

Nitpick comments:
In `@lib/screens/9receive_screen.dart`:
- Around line 790-820: Refactor to remove duplicate cleanup logic by making
_discardInvoice contain the shared cancellation/clearing/recording logic (cancel
_invoicePaymentTimer and _invoicePaymentTimeoutTimer, add paymentHash to
ClearedInvoiceStore, call unawaited(_tryCancelInvoiceOnServer(hash)), and
setState to clear _generatedInvoice), then have _clearInvoice simply call
_discardInvoice() and afterwards call _showAccentSnackBar(...) to display the
success message; update references to paymentHash, ClearedInvoiceStore.instance,
_tryCancelInvoiceOnServer, and setState in those functions to ensure behavior is
identical after delegating.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd069189-1d7f-4f56-8660-e129b4533a28

📥 Commits

Reviewing files that changed from the base of the PR and between 5646db6 and 7079d97.

📒 Files selected for processing (1)
  • lib/screens/9receive_screen.dart

Comment thread lib/screens/9receive_screen.dart
Comment thread lib/screens/9receive_screen.dart
- Add 'Clear from history' button in transaction detail bottom sheet
- Add swipe-to-dismiss on pending transaction cards
- Add confirmation dialog before clearing
- Update all locale files (de, en, es, fr, it, pt, ru) with new strings
- Integrate with ClearedInvoiceStore and InvoiceService.cancelInvoice()

Closes lachispame#112

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/screens/7history_screen.dart`:
- Around line 999-1002: The call to _invoiceService.cancelInvoice is using the
invoice key (wallet.inKey) instead of the privileged admin key; update the call
site that passes serverUrl/adminKey/paymentHash so that the X-API-KEY uses
wallet.adminKey (replace wallet.inKey with wallet.adminKey) to match other
privileged calls like sendPayment, sendPaymentToLightningAddress, and
createInvoice.
- Around line 956-959: Move the setState call so it only runs when the State is
still mounted: check the mounted guard before calling setState({}) (i.e.,
perform "if (!mounted) return;" first), then call setState and continue to show
the SnackBar via ScaffoldMessenger.of(context).showSnackBar; ensure the async
completion path that currently calls setState uses the mounted check to avoid
calling setState after disposal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 044a9266-e0e9-4df3-8613-93d4fea7ab43

📥 Commits

Reviewing files that changed from the base of the PR and between 7079d97 and 5b8c8b0.

⛔ Files ignored due to path filters (8)
  • lib/l10n/generated/app_localizations.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_de.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_en.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_es.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_fr.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_it.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_pt.dart is excluded by !**/generated/**
  • lib/l10n/generated/app_localizations_ru.dart is excluded by !**/generated/**
📒 Files selected for processing (12)
  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_pt.arb
  • lib/l10n/app_ru.arb
  • lib/main.dart
  • lib/screens/7history_screen.dart
  • lib/screens/9receive_screen.dart
  • lib/services/cleared_invoice_store.dart
  • lib/services/invoice_service.dart
✅ Files skipped from review due to trivial changes (1)
  • lib/l10n/app_ru.arb
🚧 Files skipped from review as they are similar to previous changes (4)
  • lib/main.dart
  • lib/services/invoice_service.dart
  • lib/services/cleared_invoice_store.dart
  • lib/screens/9receive_screen.dart

Comment thread lib/screens/7history_screen.dart Outdated
Comment thread lib/screens/7history_screen.dart
Delgado74 added 2 commits May 18, 2026 19:07
- Use wallet.adminKey instead of wallet.inKey for cancelInvoice calls
- Wrap ClearedInvoiceStore.instance.add() with unawaited()
- Check mounted before setState in _doClearPendingTransaction
- Cache serverUrl and WalletInfo at invoice generation for safe dispose()
- Refactor _tryCancelInvoiceOnServer to use cached fields
- Eliminate duplicate cleanup logic between _clearInvoice and _discardInvoice
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.

feat: permitir limpiar facturas pendientes desde el historial Bug: Cleared Bolt11 invoices from receive screen still appear in transaction history

1 participant