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.
This commit is contained in:
Owais Rizvi
2026-02-17 18:39:24 +05:00
committed by GitHub
parent 33d2f23955
commit 1696aab43b

View File

@@ -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(