Skip to content

fix(react-sdk): detect note status changes in setNotesIfChanged - #351

Open
kutluhaneth46 wants to merge 1 commit into
0xMiden:mainfrom
kutluhaneth46:fix/notes-if-changed-status-fingerprint
Open

fix(react-sdk): detect note status changes in setNotesIfChanged#351
kutluhaneth46 wants to merge 1 commit into
0xMiden:mainfrom
kutluhaneth46:fix/notes-if-changed-status-fingerprint

Conversation

@kutluhaneth46

Copy link
Copy Markdown

Summary

  • setNotesIfChanged / setConsumableNotesIfChanged now fingerprint notes by id plus lifecycle flags (isConsumed, isProcessing, isInclusionPending) instead of ID membership alone.
  • Fixes stale UI where useNotes() / useNoteStream() kept rendering pending status after a note was consumed on-chain.
  • Adds regression tests for input and consumable note paths.

Closes #304.

Test plan

  • npx vitest run src/__tests__/store/MidenStore.test.ts in packages/react-sdk (40/40 pass)
  • CI gate on linked client PR workflow

Compare id plus lifecycle flags (consumed/processing/inclusion-pending) so useNotes/useNoteStream re-render when a note transitions without an ID set change. Fixes 0xMiden#304.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kutluhaneth46

Copy link
Copy Markdown
Author

Portable note-status fingerprint helper (mirrors this PR): https://github.com/kutluhaneth46/miden-dev-survival-kit/blob/main/src/note-fingerprint.ts — feedback welcome if the semantics match what you want upstream.

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.

useNotesIfChanged/useNoteStream don't reflect a note's status change (pending → consumed) when the note set is otherwise unchanged

1 participant