-
-
Notifications
You must be signed in to change notification settings - Fork 137
Issue 789. Avoid the duplication of websocket messages that failed that test #790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Issue 789. Avoid the duplication of websocket messages that failed that test #790
Conversation
…the state is PAID
|
A question about NUT-17 that seems to be relevant for this test: Does NUT-17 allow duplication, i.e. a state message to be sent to the websocket even if the state hasn't changed? The text isn't very clear to me, implying that only changes are recorded:
|
hi @aaronmcdaid , NUT-17 wording: “… current state … whenever there is an update …” That phrase does not guarantee deduplication, it only says the mint must push the new state when it changes. thanks for the quick fix. |
|
I too hit the same flake while setting up a local dev environment. I've implemented the changes in this PR, ran the loop below 20 times and all green: The assertion change to >= 3 is safe: we still enforce the three expected states (unpaid, paid, issued) in order, but tolerate harmless retransmissions, no regressions spotted; happy to approve. |
|
@aaronmcdaid @KvngMikey that's amazing thank you! Finally someone found the issue! You don't know how grateful I am for this. |
|
Is there anything I can do to advance this PR, or is it good as-is? I see some of the test pipelines timed-out after six hours
Currently, the test still has To be tolerant to duplicates, how about the following? |
Thanks! Yes, sounds good to me, I hope it solves the issue with the timed-out pipelines |
|
I've pushed that change here just a few seconds ago, to allow duplicates and to test more directly what we want (first==UNPAID, last==ISSUED, with PAID appearing at least once in between) |
|
This PR needs to be rebased on main as there are some new tests |
The test ensures that the state goes from UNPAID -> PAID -> ISSUE
Sometimes though, there is duplication and the test fails: UNPAID -> UNPAID -> PAID -> PAID -> ISSUE, reported in Issue #789
After the invoice has been paid, the wallet calls
wallet.mintto convert that paid invoice into issued proofs.Every state transition calls the
callbackandwallet.mintwas being called on every state transition.In this PR, the call to
wallet.mintis made just once - just when it's PAID - instead of three times