From f904f263ab462f39b60faf34202e52b19f44faf7 Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 12 Feb 2025 14:23:14 +0400 Subject: [PATCH] Fix directs activity (#7991) Signed-off-by: Kristina Fefelova --- models/chunter/src/migration.ts | 6 ++---- plugins/chunter-resources/src/utils.ts | 11 +++++++++++ server-plugins/activity-resources/src/index.ts | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/models/chunter/src/migration.ts b/models/chunter/src/migration.ts index 979b597828..0d13ff1316 100644 --- a/models/chunter/src/migration.ts +++ b/models/chunter/src/migration.ts @@ -298,13 +298,11 @@ export const chunterOperation: MigrateOperation = { } }, { - state: 'remove-direct-members-messages', + state: 'remove-direct-doc-update-messages', func: async (client) => { await client.deleteMany(DOMAIN_ACTIVITY, { _class: activity.class.DocUpdateMessage, - attachedToClass: chunter.class.DirectMessage, - action: 'update', - 'attributeUpdates.attrKey': 'members' + attachedToClass: chunter.class.DirectMessage }) } } diff --git a/plugins/chunter-resources/src/utils.ts b/plugins/chunter-resources/src/utils.ts index 29dd815095..b98b1da52a 100644 --- a/plugins/chunter-resources/src/utils.ts +++ b/plugins/chunter-resources/src/utils.ts @@ -614,6 +614,17 @@ export async function createDirect (employeeIds: Array>): Promise 0) { for (const r of controlRules) { for (const s of r.skip) { - if (matchQuery([tx], s, r.objectClass, hierarchy).length > 0) { + if (matchQuery([tx], s, core.class.TxCUD, hierarchy).length > 0) { // Match found, we need to skip return res }