fix(cli)(#24): invoice-status and invoice-list use 'full' sync mode#26
Merged
vrogojin merged 1 commit intoMay 23, 2026
Merged
Conversation
Both commands need the IPFS / Profile pointer pull, not just the Nostr inbox. 'nostr' mode skipped that pull, so on a fresh device or after a wipe `invoice-status` reported "No invoice found matching prefix" and `invoice-list` returned an empty set — even when the invoice had been minted by another peer and was reachable on-chain. The other invoice commands (deliver, close, cancel, pay, return, receipts, notices, auto-return, transfers, export) already used 'full'. This aligns the two read-side commands with the rest. Companion sphere-sdk fix is #230 — once that lands, the receiver-side AccountingModule.invoiceTermsCache will also refresh on sync:completed and the full cross-device §C.4 flow will work end-to-end. Refs sphere-cli#24, sphere-sdk#230, sphere-sdk#223
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
case 'invoice-status'now callsensureSync(sphere, 'full')instead of'nostr'— per-target balance is computed from on-chain payment attribution, which needs the IPFS / Profile pointer pull, not just the Nostr inbox.case 'invoice-list'gets the same treatment — without it, invoices minted on another peer that propagate via Profile sync don't surface ininvoice listuntil they happen to ride a Nostr DM.Both changes carry an inline comment explaining the why so the next reader doesn't quietly flip it back to
'nostr'thinking the inbox pull is sufficient.What this fixes (and what it doesn't)
This is half of the §C.4 cross-device fix. The other half is sphere-sdk #230 — even with
'full'sync,AccountingModule.invoiceTermsCachedoesn't refresh onsync:completed, so a peer that received the invoice via Profile sync still gets "No invoice found matching prefix" until the cache is rebuilt. That fix lands separately; this PR is the CLI-side prerequisite.Acceptance (from the issue)
invoice-statuscallsensureSync(sphere, 'full')invoice-listaudited — same mismatch, also flipped to'full'manual-test-full-recovery.sh §C.4progresses past the "No invoice found" error → blocked on sphere-sdk #230Tests
npm test).npm run typecheckclean.npm run lintclean (warnings unchanged from main; no new ones).cli-invoice.integration.test.tsshape tests don't pin sync-mode, and the failure mode only repros against a multi-device testnet setup, which is the scope of #230's integration test once that lands.Closes #24.