mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 14:05:05 +02:00
Try to fix missing communication broadcast events (#9384)
This commit is contained in:
@@ -388,6 +388,12 @@ export class ClientSession implements Session {
|
||||
// We need to broadcast all collected transactions
|
||||
const broadcastPromise = ctx.pipeline.handleBroadcast(ctx.ctx)
|
||||
|
||||
await broadcastPromise
|
||||
|
||||
ctx.ctx.contextData.broadcast.queue = []
|
||||
ctx.ctx.contextData.broadcast.txes = []
|
||||
ctx.ctx.contextData.broadcast.sessions = {}
|
||||
|
||||
// ok we could perform async requests if any
|
||||
const asyncs = (ctx.ctx.contextData as SessionData).asyncRequests ?? []
|
||||
let asyncsPromise: Promise<void> | undefined
|
||||
@@ -403,13 +409,14 @@ export class ClientSession implements Session {
|
||||
}
|
||||
asyncsPromise = handleAyncs()
|
||||
}
|
||||
await broadcastPromise
|
||||
|
||||
if (asyncsPromise !== undefined) {
|
||||
await asyncsPromise
|
||||
await ctx.pipeline?.handleBroadcast(ctx.ctx)
|
||||
}
|
||||
} catch (err) {
|
||||
await ctx.sendError(ctx.requestId, 'Failed to findAll', unknownError(err))
|
||||
ctx.ctx.error('failed to findAll', { err })
|
||||
await ctx.sendError(ctx.requestId, 'Failed to domainRequest', unknownError(err))
|
||||
ctx.ctx.error('failed to domainRequest', { err })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user