New websocket subscriptions should check mint quote states #1104

Closed
opened 2025-09-22 21:28:11 +00:00 by gudnuf · 1 comment
gudnuf commented 2025-09-22 21:28:11 +00:00 (Migrated from github.com)

Mint quotes are no longer checked on startup since https://github.com/cashubtc/cdk/pull/873. Currently the http endpoints check mint quote state, but if a wallet is only using websockets the on_new_subscription method will only check the quote state in the database rather than asking the LN backend. New subscriptions should check mint quote states to make sure the wallet gets the latest actual state.

For reference, I tried to implement this here; however, we can't pass the Mint instance to the PubSubManager because that creates a circular dependency, so I passed the payment_processors to the PubSubManager. This does not seem like the best approach, so I'm not opening a PR.

Mint quotes are no longer checked on startup since https://github.com/cashubtc/cdk/pull/873. Currently the http endpoints check mint quote state, but if a wallet is only using websockets the `on_new_subscription` method will only check the quote state in the database rather than asking the LN backend. New subscriptions should check mint quote states to make sure the wallet gets the latest actual state. For reference, I tried to implement this [here](https://github.com/gudnuf/cdk/commit/05309c2c36e32f82839cbb3775299d9b1050c1bd); however, we can't pass the `Mint` instance to the `PubSubManager` because that creates a circular dependency, so I passed the `payment_processors` to the `PubSubManager`. This does not seem like the best approach, so I'm not opening a PR.
crodas commented 2025-11-04 19:39:53 +00:00 (Migrated from github.com)

Fixed on #1246

Fixed on #1246
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk#1104
No description provided.