From 1696aab43b892125a088f4c0cf82266044fe7a36 Mon Sep 17 00:00:00 2001 From: Owais Rizvi <68285890+owaisrizvi97@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:39:24 +0500 Subject: [PATCH] fix: handle empty commenter name in mention notification emails (#400) Use `||` instead of `??` so empty strings also fall back to email. The nullish coalescing operator (`??`) only catches null/undefined, so users with an empty name string would appear nameless in emails. --- packages/api/src/utils/notifications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/src/utils/notifications.ts b/packages/api/src/utils/notifications.ts index 32b32cc9..e19ac367 100644 --- a/packages/api/src/utils/notifications.ts +++ b/packages/api/src/utils/notifications.ts @@ -53,7 +53,7 @@ export async function sendMentionEmails({ const commenter = await userRepo.getById(db, commenterUserId); if (!commenter) return; - const commenterName = commenter.name ?? commenter.email; + const commenterName = commenter.name?.trim() || commenter.email; // Get mentioned members with full details (filtered by workspace) const membersWithDetails = await memberRepo.getByPublicIdsWithUsers(