From f7e984198be0730495cecf32c00c75ab5b9b28ad Mon Sep 17 00:00:00 2001 From: Arc <33088785+arcbtc@users.noreply.github.com> Date: Fri, 21 Mar 2025 12:03:52 +0000 Subject: [PATCH] Revert "tweak: fix for ws payment" (#3060) --- lnbits/core/services/notifications.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lnbits/core/services/notifications.py b/lnbits/core/services/notifications.py index c0bbba0b..a9798e42 100644 --- a/lnbits/core/services/notifications.py +++ b/lnbits/core/services/notifications.py @@ -245,12 +245,16 @@ async def send_payment_notification(wallet: Wallet, payment: Payment): async def send_ws_payment_notification(wallet: Wallet, payment: Payment): - payment_data = json.loads(payment.json()) - payment_data.pop("wallet_id", None) + # TODO: websocket message should be a clean payment model + # await websocket_manager.send_data(payment.json(), wallet.inkey) + # TODO: figure out why we send the balance with the payment here. + # cleaner would be to have a separate message for the balance + # and send it with the id of the wallet so wallets can subscribe to it payment_notification = json.dumps( { "wallet_balance": wallet.balance, - "payment": payment_data, + # use pydantic json serialization to get the correct datetime format + "payment": json.loads(payment.json()), }, ) await websocket_manager.send_data(payment_notification, wallet.inkey)