From 3466ba251e85a8d2455753ef63376a2d2d9ab842 Mon Sep 17 00:00:00 2001 From: Kristina Fefelova Date: Wed, 22 Oct 2025 16:45:41 +0400 Subject: [PATCH 1/3] Remove reaction notification on reaction unset Signed-off-by: Kristina Fefelova --- packages/server/src/notification/notification.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/server/src/notification/notification.ts b/packages/server/src/notification/notification.ts index 99f7daf..bfa83d1 100644 --- a/packages/server/src/notification/notification.ts +++ b/packages/server/src/notification/notification.ts @@ -101,8 +101,7 @@ async function removeReactionNotification ( ctx: ctx.ctx, account: ctx.account }, - meta.creator, - true + meta.creator )) as AccountUuid | undefined if (messageAccount == null) return result @@ -114,7 +113,7 @@ async function removeReactionNotification ( const toDelete = notifications.find((n) => { const content = n.content as ReactionNotificationContent - return content.emoji === reaction && content.creator === socialId + return content.emoji === reaction && n.creator === socialId }) if (toDelete === undefined) return result From 829ed6c9a51a6a00ec49d4201c4344c492eb8d50 Mon Sep 17 00:00:00 2001 From: Kristina Fefelova Date: Wed, 22 Oct 2025 16:46:22 +0400 Subject: [PATCH 2/3] Add description Signed-off-by: Kristina Fefelova --- .../fix-reaction-notification_2025-10-22-12-46.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@hcengineering/communication-server/fix-reaction-notification_2025-10-22-12-46.json diff --git a/common/changes/@hcengineering/communication-server/fix-reaction-notification_2025-10-22-12-46.json b/common/changes/@hcengineering/communication-server/fix-reaction-notification_2025-10-22-12-46.json new file mode 100644 index 0000000..1b935d6 --- /dev/null +++ b/common/changes/@hcengineering/communication-server/fix-reaction-notification_2025-10-22-12-46.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@hcengineering/communication-server", + "comment": "Remove reaction notification on reaction unset", + "type": "patch" + } + ], + "packageName": "@hcengineering/communication-server" +} \ No newline at end of file From bf3940486de2a2b5a5e4156fb8765ed08b490534 Mon Sep 17 00:00:00 2001 From: Kristina Fefelova Date: Wed, 22 Oct 2025 16:48:40 +0400 Subject: [PATCH 3/3] Fix tests Signed-off-by: Kristina Fefelova --- .../src/__tests__/notification/notification.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/server/src/__tests__/notification/notification.test.ts b/packages/server/src/__tests__/notification/notification.test.ts index cbe626c..9431cb8 100644 --- a/packages/server/src/__tests__/notification/notification.test.ts +++ b/packages/server/src/__tests__/notification/notification.test.ts @@ -708,9 +708,8 @@ describe('notification', () => { createdOn: date.getTime() } as any - const notificationContent: Pick & { title: string, shortText: string, senderName: string } = { + const notificationContent: ReactionNotificationContent = { emoji: '👍', - creator: socialId, title: 'Reacted to your message', shortText: '👍', senderName: 'John Doe' @@ -723,7 +722,8 @@ describe('notification', () => { messageId, account: accountUuid, created: date, - content: notificationContent + content: notificationContent, + creator: socialId } const context: NotificationContext = { @@ -801,9 +801,8 @@ describe('notification', () => { createdOn: date.getTime() } as any - const notificationContent: Pick & { title: string, shortText: string, senderName: string } = { + const notificationContent: ReactionNotificationContent = { emoji: '👍', - creator: socialId, title: 'Reacted to your message', shortText: '👍', senderName: 'John Doe' @@ -816,7 +815,8 @@ describe('notification', () => { messageId, account: accountUuid, created: date, - content: notificationContent + content: notificationContent, + creator: socialId } const olderNotification = {