[BUG] LNbits >= 1.0: ISO 8601 time/expiry parsed as unix seconds, paid admissions never confirmed
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #943 của @chappie-daemon — đã merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
Hướng nghiên cứu
Start with LNbitsPaymentsProcessor.getInvoice() and trace how details.time and details.expiry become invoice dates. Check the processor’s unit tests for numeric and ISO 8601 responses; done means paid invoices confirm and expired invoices retire for both formats. The issue author says a fix and tests are ready and plans to open a pull request.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
With LNbits >= 1.0 as the payments processor, paid admissions are never confirmed and expired invoices stay pending forever.
LNbits 1.x returns details.time and details.expiry from GET /api/v1/payments/{payment_hash} as ISO 8601 strings (e.g. "2025-10-11T15:24:27+00:00"); LNbits 0.x returned unix seconds. LNbitsPaymentsProcessor still does new Date(data.details.time * 1000) / new Date(data.details.expiry * 1000), which yields Invalid Date for strings. As a result:
PaymentsService.confirmInvoice→InvoiceRepository.confirmInvoicecallsconfirmedAt.toISOString()→RangeError: Invalid time value, so a user who paid the admission invoice is not admitted (both from the/callbacks/lnbitswebhook and from the maintenance worker poll);isExpiredInvoice()is false for an invalidexpiresAt, so unpaid invoices that LNbits still knows are re-saved aspendingon every maintenance pass and never retired.
To Reproduce
- Run nostream with
payments.enabled: true,payments.processor: lnbitsagainst LNbits 1.x (seen with 1.5.6). - Request an admission invoice at
/invoicesand pay it. - The invoice is not confirmed and the pubkey is not admitted; unpaid invoices past their expiry remain
pendingin theinvoicestable.
Unit-level reproduction: feed invoiceResponse({ data: { paid: true }, details: { time: '2025-10-11T15:24:27+00:00' } }) to LNbitsPaymentsProcessor.getInvoice() — confirmedAt is Invalid Date.
Expected behavior
Dates from LNbits are parsed correctly whether they come as unix seconds (LNbits < 1.0) or ISO 8601 strings (LNbits >= 1.0); paid invoices get confirmed, expired ones get retired.
System
- OS: Ubuntu 22.04
- Platform: docker (compose)
- Version: nostream 3.4.1 (same code in 2.1.0 and current
main); LNbits 1.5.6
Logs
On 3.4.1 after the upgrade, 15 old unpaid invoices that LNbits still knows were re-saved as pending every minute; with the fix applied they were retired as expired on the next maintenance pass.
Additional context
I have a small fix with unit tests ready (accept both a number and an ISO string in the LNbits processor) and will open a PR referencing this issue.
- Ngôn ngữ chính
- TypeScript
- Star
- 829
- Fork
- 234
- Merge trung bình
- 17 giờ 6 phút
- Pull request đã merge (30 ngày)
- 92
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cameri/nostream
-
factory rewrite rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
factory rewrite rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cameri/nostream#991 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test: user-subscription specs fail outside UTC, so the pre-commit hook cannot passCó thể đã có người làm @tejasvasingh2004 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cameri/nostream#971 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug factory rewrite rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cameri/nostream#960 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug factory rewrite rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cameri/nostream
Issue tương tự
-
Native Web
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
digitalfabrik/integreat-app#4517 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
TLS guide repeats certs/ in the certificate directoryCó thể đã có người làm @maheshrijal đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
prometheus/docs#3156 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
medusajs/dtc-starter#90 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
usability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
inmanta/web-console#7632 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
zaidmukaddam/scira#261 ·