Data returned from wallet websocket was not json (#1823)

* Fixed walet websocket json

* format
This commit is contained in:
Arc 2023-07-19 12:14:03 +01:00 committed by GitHub
parent f384c5c366
commit a3aafe4b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View File

@ -251,10 +251,12 @@ async def pay_invoice(
if wallet: if wallet:
await websocketUpdater( await websocketUpdater(
wallet_id, wallet_id,
{ json.dumps(
"wallet_balance": wallet.balance or None, {
"payment": payment._asdict(), "wallet_balance": wallet.balance or None,
}, "payment": payment._asdict(),
}
),
) )
logger.debug(f"payment successful {payment.checking_id}") logger.debug(f"payment successful {payment.checking_id}")
elif payment.checking_id is None and payment.ok is False: elif payment.checking_id is None and payment.ok is False:

View File

@ -1,6 +1,6 @@
// update cache version every time there is a new deployment // update cache version every time there is a new deployment
// so the service worker reinitializes the cache // so the service worker reinitializes the cache
const CACHE_VERSION = 48 const CACHE_VERSION = 50
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-` const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
const getApiKey = request => { const getApiKey = request => {

View File

@ -1,4 +1,5 @@
import asyncio import asyncio
import json
from typing import Dict, Optional from typing import Dict, Optional
import httpx import httpx
@ -124,10 +125,12 @@ async def wait_for_paid_invoices(invoice_paid_queue: asyncio.Queue):
if wallet: if wallet:
await websocketUpdater( await websocketUpdater(
payment.wallet_id, payment.wallet_id,
{ json.dumps(
"wallet_balance": wallet.balance or None, {
"payment": payment.dict(), "wallet_balance": wallet.balance or None,
}, "payment": payment.dict(),
}
),
) )
# dispatch webhook # dispatch webhook
if payment.webhook and not payment.webhook_status: if payment.webhook and not payment.webhook_status: