Skip to content

[codex] Preserve explicit SenderName in request email headers#2169

Open
shuaick wants to merge 1 commit intoOpenSignLabs:stagingfrom
shuaick:fix-sender-name-mail
Open

[codex] Preserve explicit SenderName in request email headers#2169
shuaick wants to merge 1 commit intoOpenSignLabs:stagingfrom
shuaick:fix-sender-name-mail

Conversation

@shuaick
Copy link
Copy Markdown

@shuaick shuaick commented May 8, 2026

Fixes #2168.

Summary

  • preserve the document's explicit SenderName when building the outgoing request email from field
  • extract the sender-selection precedence into a tiny pure helper
  • add regression coverage for explicit sender name, owner-name fallback, and email fallback behavior

Root cause

sendEmailToSigners mixed || with a ternary expression without grouping. In JavaScript that evaluates as (SenderName || useNameAsSender) ? ... : ..., so any truthy SenderName still routed to ExtUserPtr.Name instead of preserving the explicit sender name stored on the document.

Validation

  • direct Node assertions covering the intended sender precedence
  • added a focused Vitest test file for the helper

Notes

I could not run the Vitest runner end-to-end in this local Windows environment because Vite/esbuild process spawn hit EPERM, but the helper behavior was exercised directly with Node assertions.

Request-signature emails could display the owner profile name in the from field even when a document already carried an explicit SenderName. The ternary condition in sendEmailToSigners was relying on operator precedence, so any truthy SenderName still routed to ExtUserPtr.Name.

This extracts the sender selection into a tiny helper, uses it in the request-email flow, and adds regression coverage for the intended precedence.

Constraint: Keep the change narrowly scoped to request-email sender selection so the existing mail flow stays stable
Rejected: Parenthesize the existing inline expression only | harder to test in isolation and easier to regress later
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: When sender identity precedence changes, keep the pure helper and its tests aligned with the document fields that drive email customization
Tested: Direct Node assertions for explicit SenderName, UseNameAsSender fallback, and senderEmail fallback
Not-tested: Vitest runner in this environment (blocked by local Windows EPERM when Vite/esbuild spawns)
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

Someone is attempting to deploy a commit to the prafull 's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request emails use the owner name instead of SenderName when both are present

1 participant