From 536a7ce1faac215ae33f348c20f6b563c6724e14 Mon Sep 17 00:00:00 2001 From: Gigi Date: Fri, 17 Oct 2025 20:46:00 +0200 Subject: [PATCH] fix: disable account queue during batch decrypt operations The applesauce BaseAccount queues requests by default, waiting for each to complete before sending the next. This caused decrypt requests to timeout before ever reaching Amber/bunker. Solution: - Set disableQueue=true before batch operations - All decrypt requests sent immediately - Restore original queue state after completion This should fix the hanging/timeout issue where Amber never saw the decrypt requests because they were stuck in the account's queue. Ref: https://hzrd149.github.io/applesauce/typedoc/classes/applesauce-accounts.BaseAccount.html#disablequeue --- src/services/bookmarkProcessing.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/services/bookmarkProcessing.ts b/src/services/bookmarkProcessing.ts index fe04f346..161e1959 100644 --- a/src/services/bookmarkProcessing.ts +++ b/src/services/bookmarkProcessing.ts @@ -196,11 +196,21 @@ export async function collectBookmarksFromEvents( // Decrypt events sequentially const privateItemsAll: IndividualBookmark[] = [] if (decryptJobs.length > 0 && signerCandidate) { - for (const job of decryptJobs) { - const privateItems = await decryptEvent(job.evt, activeAccount, signerCandidate, job.metadata) - if (privateItems && privateItems.length > 0) { - privateItemsAll.push(...privateItems) + // Disable queueing for batch operations to avoid blocking on user interaction + const accountWithQueue = activeAccount as { disableQueue?: boolean } + const originalQueueState = accountWithQueue.disableQueue + accountWithQueue.disableQueue = true + + try { + for (const job of decryptJobs) { + const privateItems = await decryptEvent(job.evt, activeAccount, signerCandidate, job.metadata) + if (privateItems && privateItems.length > 0) { + privateItemsAll.push(...privateItems) + } } + } finally { + // Restore original queue state + accountWithQueue.disableQueue = originalQueueState } }