mirror of
https://github.com/dergigi/boris.git
synced 2026-01-05 07:54:25 +01:00
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
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user