feat: Mutex redesign - isolate event processing for better ordering and throughput (#2137)
* fix: improve message resend logic by adding checks for message IDs * Revert "fix: improve message resend logic by adding checks for message IDs" This reverts commit c03f9d8e6fc6cbfbb9d1f8f67c169700e704213d. * fix: introduce separate mutexes for message, receipt, app state patch, and notification processing * fix: remove unused processing mutex for notifications
This commit is contained in:
@@ -71,7 +71,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
const {
|
||||
ev,
|
||||
authState,
|
||||
processingMutex,
|
||||
messageMutex,
|
||||
signalRepository,
|
||||
upsertMessage,
|
||||
query,
|
||||
@@ -1199,7 +1199,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
})
|
||||
if (config.emitOwnEvents) {
|
||||
process.nextTick(async () => {
|
||||
await processingMutex.mutex(() => upsertMessage(fullMsg, 'append'))
|
||||
await messageMutex.mutex(() => upsertMessage(fullMsg, 'append'))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user