UBER-1239: fix missing notifications for mentions from doc (#4820)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2024-02-29 13:32:09 +07:00
committed by GitHub
parent a8351802d1
commit ff9e4abb7d
@@ -609,6 +609,15 @@ export async function createCollabDocInfo (
}
const targets = new Set(collaborators)
// user is not collaborator of himself, but we should notify user of changes related to users account (mentions, comments etc)
if (control.hierarchy.isDerived(object._class, contact.class.Person)) {
const acc = await getPersonAccount(object._id as Ref<Person>, control)
if (acc !== undefined) {
targets.add(acc._id)
}
}
const notifyContexts = await control.findAll(notification.class.DocNotifyContext, {
attachedTo: { $in: activityMessage.map(({ attachedTo }) => attachedTo) }
})