refactor: disable account queue globally

Set accounts.disableQueue = true on AccountManager during initialization:
- Applies to all accounts automatically
- No need for temporary queue toggling in individual operations
- Makes all bunker requests instant (no internal queueing)

Removed temporary queue disabling from bookmarkProcessing.ts since
it's now globally disabled.

Updated Amber.md to document the global approach.

This eliminates the root cause of decrypt hangs - requests no longer
wait in an internal queue for previous requests to complete.
This commit is contained in:
Gigi
2025-10-17 21:19:21 +02:00
parent 0785b034e4
commit 8eaba04d91
7 changed files with 24 additions and 40 deletions

View File

@@ -189,21 +189,11 @@ export async function collectBookmarksFromEvents(
// Decrypt events sequentially
const privateItemsAll: IndividualBookmark[] = []
if (decryptJobs.length > 0 && signerCandidate) {
// 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)
}
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
}
}