Skip to content

Add PocketMoney extension v0.1.2 - #849

Open
TrezorHannes wants to merge 3 commits into
lnbits:mainfrom
TrezorHannes:add-pocketmoney-extension
Open

TrezorHannes wants to merge 3 commits into
lnbits:mainfrom
TrezorHannes:add-pocketmoney-extension

Conversation

@TrezorHannes

@TrezorHannes TrezorHannes commented Sep 19, 2026 •

Copy link
Copy Markdown

Summary

Adds PocketMoney (https://github.com/TrezorHannes/pocketmoney) v0.1.2 to the vetted extensions registry.

PocketMoney is an automated recurring disbursements, family allowance, and payroll scheduler for LNbits. It automates recurring batch payouts over the Bitcoin Lightning Network to internal child/peer LNbits wallets or external recipients in any currency.

What's in v0.1.2 (contributor: @talvasconcelos)

  • PostgreSQL full compatibility — All TIMESTAMP writes pinned to UTC via db.timestamp_placeholder() AT TIME ZONE 'UTC'
  • Stale claim recovery — Dead workers no longer wedge a plan's is_running lock; reclaimed automatically after 10 minutes
  • m003 + m004 migrations — Adds running_since column and fixes historical Postgres timestamps
  • Webhook fires freely — External event-driven triggers (Home Assistant, cron, Zapier) work regardless of next_run_at
  • Daemon collision silent — Normal multi-worker scheduling contention no longer writes false FAILED audit records
  • Full test coverage including Postgres mock, stale claim, DST migration, and off-schedule webhook tests

Key Features

  • Universal Recipient Support: Internal LNbits wallets (zero-fee) and external Lightning Addresses / LNURL-pay
  • JIT Multi-Currency: EUR, USD, GBP, or sats with just-in-time exchange rate conversion
  • Fail-Closed Safety: Insufficient balance or slippage skips execution safely with alert
  • Flexible Recurrence: Daily/weekly/monthly presets or custom 5-part cron with timezone support
  • Interactive Dashboard: Dry-run simulator, manual trigger, audit log, setup guide, Swagger API docs
  • Secret Webhook Triggers: High-entropy per-plan endpoints for headless automation
  • Telegram Alerts: Success, partial failure, and low-balance notifications
  • Zero New Dependencies: Uses only packages bundled in LNbits core

Manifest Metadata

  • id: pocketmoney
  • version: 0.1.2
  • min_lnbits_version: 0.12.0
  • archive: https://github.com/TrezorHannes/pocketmoney/archive/refs/tags/v0.1.2.zip
  • hash: 3aedd2feb097c1f45dcd7b9582d2717a202a8c978850d466ee08a576c227795e

Verification

  • [✓] python3 check.py pocketmoney — hash matches, icon 512×512 RGB OK, min_lnbits_version valid
  • [✓] JSON syntax validated
  • [✓] Rebased cleanly on upstream main (e84352e)
  • [✓] CI passing on Python 3.12 (lint + full test suite)

@TrezorHannes TrezorHannes changed the title Add PocketMoney extension v0.1.0 Add PocketMoney extension v0.1.1 Sep 19, 2026
@talvasconcelos

Copy link
Copy Markdown
Contributor

Create a recurring payment fails on postgres, it needs a review on the timestamps: expected a datetime.date or datetime.datetime instance, got 'float'

LNbits has helpers for this.

@talvasconcelos

talvasconcelos commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

@TrezorHannes , I'll fix postgres issues and push changes to your repo! Can you give me access to your repo, please?

@TrezorHannes

Copy link
Copy Markdown
Author

Thanks a lot for investigating and opening PR #10! Direct repo access shouldn't be needed since you already submitted the fix cleanly via your fork. We're reviewing and merging it now, and will update this PR with the new release tag once tagged.

@TrezorHannes

Copy link
Copy Markdown
Author

@talvasconcelos let me know if you want to keep the ownership of the PR, or should I tackle the commits to close those off? Thanks

@talvasconcelos

Copy link
Copy Markdown
Contributor

@talvasconcelos let me know if you want to keep the ownership of the PR, or should I tackle the commits to close those off? Thanks

I'm working on it now!

@TrezorHannes

Copy link
Copy Markdown
Author

Hi @talvasconcelos! 👋

We've completed a full code review of PR #10 (your PostgreSQL fixes), iterated with you on the feedback, and merged everything into main.

✅ What was reviewed & resolved

Talvasconcelos submitted 5 commits addressing PostgreSQL compatibility (UTC timestamp pinning, stale claim recovery, row model mapping, and webhook improvements). Our review flagged 6 issues — all 4 P1s and both P2s were addressed in your follow-up commits:

Issue Severity Resolution
Incomplete Postgres mock in test — db.type not patched P1 ✅ monkeypatch.setattr(db, "type", "POSTGRES") added
Wrong SQL assertion strings (missing ( and AT TIME ZONE 'UTC') P1 ✅ Assertions corrected to full UTC-pinned expressions
Webhook hard-blocked off-schedule calls — broke HA/cron automations P1 ✅ Date gate removed; new test confirms webhook fires freely
release_plan_running left running_since dirty on idle plans P1 ✅ SET is_running = FALSE, running_since = NULL
DST flaw in m004 migration — current-instant offset applied to all history P2 ✅ Uses current_setting('TimeZone') per-row instead
Daemon claim collision → false FAILED audit records every 30s P2 ✅ Daemon path returns None silently, no audit spam

📦 Merged commit

445478e — fix(postgres): UTC timestamps, stale claim recovery, and webhook improvements

CI is green on Python 3.12 (lint + full test suite including the new Postgres bind guard, stale claim, migration, and webhook-off-schedule tests).

The extension is now on main and ready. We'll cut a new release tag and update the registry entry here separately. Thank you for the contribution! 🙏

@TrezorHannes
TrezorHannes force-pushed the add-pocketmoney-extension branch from dcf4e3a to 07db359 Compare September 28, 2026 22:35
@TrezorHannes TrezorHannes changed the title Add PocketMoney extension v0.1.1 Add PocketMoney extension v0.1.2 Sep 28, 2026

This branch has not been deployed

No deployments
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.

2 participants