Cache providers for common notifications (#11047)

Signed-off-by: Artyom Savchenko <armisav@gmail.com>
This commit is contained in:
Artyom Savchenko
2026-09-25 18:39:28 +02:00
committed by GitHub
parent afa747d065
commit c1548a8a52
@@ -115,7 +115,7 @@ export async function getCommonNotificationTxes (
const res: Tx[] = []
const notifyContexts = await control.findAll(ctx, notification.class.DocNotifyContext, { objectId: attachedTo })
await pushInboxNotifications(
const notificationTx = await pushInboxNotifications(
ctx,
control,
res,
@@ -133,6 +133,13 @@ export async function getCommonNotificationTxes (
tx
)
if (notificationTx !== undefined) {
const availableProviders: AvailableProvidersCache =
control.contextCache.get(AvailableProvidersCacheKey) ?? new Map()
availableProviders.set(notificationTx.objectId, Array.from(notifyResult.keys()))
control.contextCache.set(AvailableProvidersCacheKey, availableProviders)
}
return res
}