Skip to content

Rediscover private notes before each operation (0.4.4) - #46

Merged
adrianvrj merged 1 commit into
mainfrom
fix/privacy-rediscover
Oct 20, 2026
Merged

adrianvrj merged 1 commit into
mainfrom
fix/privacy-rediscover

Conversation

@adrianvrj

Copy link
Copy Markdown
Contributor

Summary

Found testing 0.4.3 on Sepolia with the production vault:

  • register, deposit and a private transfer all succeeded;
  • the next operation failed with Insufficient balance ... (total available: 0);
  • privacy.balance() still reported the 0.1 STRK.

Cause. Before each operation the session cleared the registry notes but kept the discovery cursor. Given a cursor, the hosted indexer (/v1/sync/incoming_state) returns only notes after it, so the registry came back empty. balance() discovers without a cursor, which is why it saw the funds.

Fix. Clear the notes and the cursor together, as the SDK itself does when it recovers from a reorg. Every operation rediscovers from scratch, exactly like balance().

Merging publishes @cavos/kit@0.4.4.

Test plan

  • New test: the discovery calls during transfer and withdraw carry no cursor, and the balance is right afterwards.
  • npx jest: 449 passed.
  • npm run build
  • Sepolia with the production vault after release: transfer, then withdraw.

The session cleared the registry notes but kept the discovery cursor, so the hosted indexer returned nothing before that cursor and every operation after the first saw a zero balance. Clear both, as the SDK itself does after a reorg. Release as 0.4.4.
@adrianvrj
adrianvrj merged commit 68a89cb into main Oct 20, 2026
2 checks passed
@adrianvrj
adrianvrj deleted the fix/privacy-rediscover branch October 20, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant