Skip to content

feat: add configurable threshold for balance delta notification#3433

Merged
motorina0 merged 4 commits intolnbits:devfrom
BenGWeeks:feat/balance-delta-threshold-issue-3432
Nov 12, 2025
Merged

feat: add configurable threshold for balance delta notification#3433
motorina0 merged 4 commits intolnbits:devfrom
BenGWeeks:feat/balance-delta-threshold-issue-3432

Conversation

@BenGWeeks
Copy link
Copy Markdown
Contributor

Summary

Fixes #3432 - Adds a configurable threshold (in sats) for the "Balance Delta Changed" notification, so it only alerts when the balance delta changes by more than the specified amount.

Changes

  • Backend: Replace boolean notification_balance_delta_changed with integer notification_balance_delta_threshold_sats setting (default: 1)
  • Logic: Update check_balance_delta_changed() to check if delta change is >= threshold using absolute value
  • UI: Replace toggle with numeric input field (matches style of other notification thresholds)
  • Translations: Update description to explain threshold functionality and fix typo ("diference" → "difference")
  • Frontend: Rebuild bundle with updated translations

Benefits

  • Routing node operators can filter out notifications for small balance changes
  • Backwards compatible - default value of 1 maintains current behavior
  • Setting to 0 disables notifications entirely
  • Follows existing pattern used by other notification thresholds (Server Status, Incoming/Outgoing Payments)

Testing

  • All linters passed (make format)
  • Frontend bundle rebuilt (npm run bundle)
  • Container runs successfully
  • Manual testing with FakeWallet (draft status - needs real-world testing)

Screenshots

The Balance Delta notification now has a numeric input instead of a toggle, allowing users to specify the minimum change threshold in sats.

Notes

This is a draft PR pending manual testing with notifications configured. The implementation is complete and all automated checks pass.

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.11%. Comparing base (1e6e97c) to head (a1d3876).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #3433   +/-   ##
=======================================
  Coverage   56.11%   56.11%           
=======================================
  Files         117      117           
  Lines       15709    15710    +1     
=======================================
+ Hits         8815     8816    +1     
  Misses       6894     6894           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@motorina0 motorina0 requested review from dni and motorina0 November 12, 2025 09:11
@motorina0 motorina0 force-pushed the feat/balance-delta-threshold-issue-3432 branch from e229002 to 3e347a2 Compare November 12, 2025 09:14
BenGWeeks and others added 3 commits November 12, 2025 11:22
…ts#3432)

Replaces boolean toggle with numeric threshold input, allowing users to set a minimum change amount (in sats) before receiving balance delta notifications.

- Add notification_balance_delta_threshold_sats setting (default: 1 sat)
- Update check_balance_delta_changed() to use threshold comparison
- Replace toggle with numeric input in admin UI
- Update translations to reflect threshold behavior
- Fix typo: "diference" → "difference"

Benefits:
- Routing node operators can filter out small balance changes
- Setting to 0 disables notifications
- Default of 1 maintains backward compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@motorina0 motorina0 force-pushed the feat/balance-delta-threshold-issue-3432 branch from d229acf to 63b14d4 Compare November 12, 2025 09:22
@motorina0 motorina0 marked this pull request as ready for review November 12, 2025 09:25
@motorina0 motorina0 merged commit c897212 into lnbits:dev Nov 12, 2025
44 checks passed
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.

[Feature request] Add configurable threshold for balance delta notification

2 participants