Skip to content

fix(core): wait for paid quote subscription states#181

Closed
Egge21M wants to merge 3 commits into
masterfrom
feat/bls
Closed

fix(core): wait for paid quote subscription states#181
Egge21M wants to merge 3 commits into
masterfrom
feat/bls

Conversation

@Egge21M

@Egge21M Egge21M commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make quote subscription wait helpers ignore non-terminal/current-state notifications.
  • Resolve mint quote waits only on PAID or ISSUED, and melt quote waits only on PAID.
  • Add focused SubscriptionApi unit coverage for initial unpaid/pending notifications.
  • Add a patch changeset for @cashu/coco-core.

Problem

Fakewallet quote subscriptions may first emit the current quote state, which can still be UNPAID. awaitMintQuotePaid previously resolved on the first notification, so minting could continue too early and fail with Quote not paid.

Verification

  • bun run --filter='@cashu/coco-core' test -- test/unit/SubscriptionApi.test.ts
  • bun run --filter='@cashu/coco-core' typecheck
  • bun run --filter='@cashu/coco-adapter-tests' typecheck
  • MINT_URL=https://bls.thesimplekid.dev ./scripts/test-integration.sh core passed locally in the existing dirty BLS worktree while diagnosing this failure.
  • env BUN_TMPDIR=/tmp/codex-bun-tmp bunx @changesets/cli status --verbose

@changeset-bot

changeset-bot Bot commented May 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 952d3f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@cashu/coco-core Patch
@cashu/coco-adapter-tests Patch
@cashu/coco-expo-sqlite Patch
@cashu/coco-indexeddb Patch
@cashu/coco-react Patch
@cashu/coco-sqlite-bun Patch
@cashu/coco-sqlite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.50%. Comparing base (c321b30) to head (952d3f9).

Files with missing lines Patch % Lines
packages/core/api/SubscriptionApi.ts 94.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #181      +/-   ##
==========================================
+ Coverage   84.29%   84.50%   +0.21%     
==========================================
  Files         115      115              
  Lines       13928    13946      +18     
==========================================
+ Hits        11740    11785      +45     
+ Misses       2188     2161      -27     
Flag Coverage Δ
core-integration 54.01% <ø> (ø)
core-unit 87.79% <94.59%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Egge21M Egge21M marked this pull request as ready for review May 20, 2026 20:45
@Egge21M Egge21M closed this Jun 8, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in coco Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant