Skip to content

invoice-status uses ensureSync(sphere, 'nostr') — should be 'full' to trigger IPFS pull #24

Description

@vrogojin

Summary

src/legacy/legacy-cli.ts case 'invoice-status' calls:

await ensureSync(sphere, 'nostr');

But invoice-status displays per-target balance from on-chain payment attribution, which requires IPFS-pulled state (not just Nostr-pulled inbox). 'nostr' mode doesn't trigger the IPFS / Profile pull, so on a fresh device or after a wipe, invoice-status reports stale or empty status.

The other invoice commands use the right mode:

  • case 'invoice-deliver'ensureSync(sphere, 'full')
  • case 'invoice-status'ensureSync(sphere, 'nostr') ✗ (should be 'full')
  • case 'invoice-list'ensureSync(sphere, 'nostr') (probably also wrong, same reasoning)

Fix

Trivial — change 'nostr' to 'full' in the case 'invoice-status' handler (and probably case 'invoice-list' too, but worth confirming separately):

       case 'invoice-status': {
         ...
         const sphere = await getSphere();
         ...
-        await ensureSync(sphere, 'nostr');
+        await ensureSync(sphere, 'full');
         ...

Note on the deeper bug

This fix alone won't make invoice-status work on a peer that received the invoice via Nostr — that needs sphere-sdk #230 (AccountingModule.invoiceTermsCache refresh on sync:completed). Both fixes are required for the full cross-device flow.

Related

Acceptance

  • invoice-status calls ensureSync(sphere, 'full')
  • Audit invoice-list for the same mismatch
  • Verify manual-test-full-recovery.sh §C.4 progresses past the "No invoice found matching prefix" error (with sphere-sdk #230 also landed)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions