diff --git a/src/Utils/auth-utils.ts b/src/Utils/auth-utils.ts index d87e8a4e..e20144ca 100644 --- a/src/Utils/auth-utils.ts +++ b/src/Utils/auth-utils.ts @@ -116,7 +116,6 @@ export const addTransactionCapability = ( logger: ILogger, { maxCommitRetries, delayBetweenTriesMs }: TransactionCapabilityOptions ): SignalKeyStoreWithTransaction => { - // AsyncLocalStorage for transaction context const txStorage = new AsyncLocalStorage() // Queues for concurrency control @@ -189,9 +188,8 @@ export const addTransactionCapability = ( const ctx = txStorage.getStore() if (!ctx) { - // No transaction - direct read with mutex protection (not queue) - // Use mutex instead of queue to provide mutual exclusion for reads and writes, reducing queuing overhead and improving event loop responsiveness (does not allow concurrent reads) - return getTxMutex(type).runExclusive(() => state.get(type, ids)) + // No transaction - direct read without exclusive lock for concurrency + return state.get(type, ids) } // In transaction - check cache first