Skip to content

Commit

Permalink
UBER-1239: fix missing notifications for mentions from doc (hcenginee…
Browse files Browse the repository at this point in the history
…ring#4820)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
Signed-off-by: Tiago Cruz <tcruz@netic.io>
  • Loading branch information
kristina-fefelova authored and tjaoc committed Mar 5, 2024
1 parent 9f90703 commit 0a74937
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server-plugins/notification-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
})
Expand Down

0 comments on commit 0a74937

Please sign in to comment.