From c1548a8a52d42e58ac773ab1b93fe1ca021a1a23 Mon Sep 17 00:00:00 2001 From: Artyom Savchenko Date: Fri, 25 Sep 2026 18:39:28 +0200 Subject: [PATCH] Cache providers for common notifications (#11047) Signed-off-by: Artyom Savchenko --- server-plugins/notification-resources/src/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server-plugins/notification-resources/src/index.ts b/server-plugins/notification-resources/src/index.ts index ceb252f5f3..9f5b80b78c 100644 --- a/server-plugins/notification-resources/src/index.ts +++ b/server-plugins/notification-resources/src/index.ts @@ -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 }