fix: note consume issues: batch consume, mutex contention, stuck transactions#133
Open
zacnider wants to merge 1 commit into0xMiden:mainfrom
Open
fix: note consume issues: batch consume, mutex contention, stuck transactions#133zacnider wants to merge 1 commit into0xMiden:mainfrom
zacnider wants to merge 1 commit into0xMiden:mainfrom
Conversation
…tuck tx recovery - Pause AutoSync on all platforms during consume (not just mobile) to eliminate WASM mutex contention between sync and consume operations - Pause claimable notes polling during consume (refreshInterval=0 when modal open) - Add batch consume: "Claim All" now creates a single transaction for all notes instead of N separate transactions, leveraging SDK's newConsumeTransactionRequest(Note[]) - Fix stuck transaction blocking entire queue: auto-cancel transactions stuck in GeneratingTransaction state for >1 minute, allowing queued transactions to proceed - Reduce desktop stuck transaction timeout from 30 minutes to 5 minutes - Add noteIds[] support to ConsumeTransaction for batch operations - Update verifyStuckTransactionsFromNode and completeConsumeTransaction for batch support
9ba6361 to
3c7e3e7
Compare
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
This PR fixes three critical note consume issues in the Miden Wallet Chrome extension:
GeneratingTransactionstate blocks all subsequent transactions indefinitely (30min timeout on desktop)Changes
Fix 1: Pause AutoSync during consume on all platforms
isMobile()guard so AutoSync pauses on desktop too when transaction modal is openFix 2: Pause claimable notes polling during consume
refreshIntervalto 0 whenisTransactionModalOpenis truenotesBeingClaimedfilter to support batchnoteIdsFix 3: Batch consume - multiple notes in a single transaction
ConsumeTransactionnow acceptsConsumableNote[]and storesnoteIds: string[]noteIdsarray (SDK already supportsNote[])initiateBatchConsumeTransaction()for single batch transactionFix 4: Auto-cancel stuck transactions in processing loop
GeneratingTransactionstate and auto-cancels themFix 5: Reduce desktop stuck transaction timeout (30min → 5min)
Test plan
yarn build:extension