From 1f0c7807638422cc8db329123a6a5c6628b62a79 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 8 Feb 2026 22:15:26 +0000 Subject: [PATCH] feat: skip pending members in sendMentionEmails --- apps/web/src/views/card/index.tsx | 5 +++-- packages/api/src/utils/notifications.ts | 2 ++ packages/db/src/repository/board.repo.ts | 1 + packages/db/src/repository/card.repo.ts | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/web/src/views/card/index.tsx b/apps/web/src/views/card/index.tsx index da2bc27c..68a295d4 100644 --- a/apps/web/src/views/card/index.tsx +++ b/apps/web/src/views/card/index.tsx @@ -167,7 +167,6 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) { const { modalContentType, entityId, - openModal, getModalState, clearModalState, isOpen, @@ -198,6 +197,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) { }; const board = card?.list.board; + const workspaceMembers = board?.workspace.members; const boardId = board?.publicId; const updateCard = api.card.update.useMutation({ @@ -286,6 +286,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) { if (!cardId) return <>; + return ( <> handleSubmit(onSubmit)() : undefined } - workspaceMembers={board?.workspace.members ?? []} + workspaceMembers={workspaceMembers ?? []} readOnly={!canEdit} /> diff --git a/packages/api/src/utils/notifications.ts b/packages/api/src/utils/notifications.ts index d898e1dc..32b32cc9 100644 --- a/packages/api/src/utils/notifications.ts +++ b/packages/api/src/utils/notifications.ts @@ -77,6 +77,8 @@ export async function sendMentionEmails({ membersToNotify.map(async (member) => { const userId = member.user?.id; const email = member.user?.email ?? member.email; + + // Skip pending members (no userId) - they can be mentioned but won't receive emails if (!userId || !email) return; try { diff --git a/packages/db/src/repository/board.repo.ts b/packages/db/src/repository/board.repo.ts index 7878b20a..3d709f41 100644 --- a/packages/db/src/repository/board.repo.ts +++ b/packages/db/src/repository/board.repo.ts @@ -212,6 +212,7 @@ export const getByPublicId = async ( columns: { publicId: true, email: true, + status: true, }, with: { user: { diff --git a/packages/db/src/repository/card.repo.ts b/packages/db/src/repository/card.repo.ts index e70d7d81..5dd08580 100644 --- a/packages/db/src/repository/card.repo.ts +++ b/packages/db/src/repository/card.repo.ts @@ -508,6 +508,7 @@ export const getWithListAndMembersByPublicId = async ( columns: { publicId: true, email: true, + status: true, }, with: { user: {