Skip to content

fix: check melt status in ws notification receiver#2135

Open
asmogo wants to merge 2 commits into
cashubtc:mainfrom
asmogo:fix/nutshell-melt-status-recheck
Open

fix: check melt status in ws notification receiver#2135
asmogo wants to merge 2 commits into
cashubtc:mainfrom
asmogo:fix/nutshell-melt-status-recheck

Conversation

@asmogo

@asmogo asmogo commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Description


Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

  • I followed the code style guidelines
  • I ran just quick-check before committing
  • If the Wallet API was modified (added/removed/changed), I have reflected those changes in the FFI bindings (crates/cdk-ffi)

@github-project-automation github-project-automation Bot moved this to Backlog in CDK Jun 21, 2026
@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.63492% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.82%. Comparing base (e7d358c) to head (f8c57ee).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/cdk/src/wallet/melt/mod.rs 95.15% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2135      +/-   ##
==========================================
+ Coverage   71.60%   71.82%   +0.22%     
==========================================
  Files         356      356              
  Lines       74106    74355     +249     
==========================================
+ Hits        53061    53408     +347     
+ Misses      21045    20947      -98     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asmogo

asmogo commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

This fixes the 'melting from nutshell' issues that I witnessed a couple of days ago.

@asmogo asmogo marked this pull request as ready for review June 22, 2026 08:42
@asmogo asmogo requested a review from thesimplekid June 22, 2026 08:42
@asmogo

asmogo commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

I'll add some more tests soon.

The status-recheck logic in PendingMelt::wait (commit b7a12f4) had 0%
patch coverage. Extract the non-Paid reconciliation block into a testable
helper reconcile_non_paid_status (behavior-preserving) and add unit tests
for every branch:

- HTTP Paid -> finalize
- HTTP Pending/Unknown -> keep waiting
- HTTP Unpaid/Failed without proof -> fail
- HTTP Failed with proof -> keep waiting (avoid proof loss)
- HTTP status-check error -> run recovery

Adds MockMintConnector::push_melt_quote_status_response for staging a
sequence of status responses and create_test_wallet_with_mock_http_subscription
to drive subscription flows over HTTP deterministically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thesimplekid thesimplekid requested a review from crodas June 22, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant