Repository navigation
fix(plugin-email,service-settings): a sender with no From name goes out under the product name - #30548
Conversation
…out under the product name WIP: implementation and pins; gates follow. Claude-Session: https://claude.ai/code/session_01Utp6CbJtwiuT8bs47ARmYb Co-authored-by: Claude <noreply@anthropic.com>
…g EmailService's surface unchanged Claude-Session: https://claude.ai/code/session_01Utp6CbJtwiuT8bs47ARmYb Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbJtwiuT8bs47ARmYb Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 14 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9abb0d49bba823ce1fbf94b7749c7074a1c5c356 && git checkout 9abb0d49bba823ce1fbf94b7749c7074a1c5c356
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c045c341329ddcd83abe4adf12428e100b7a700a a2519c047868b21653e0f91af041af35fcf3c846 && git checkout -B drift-repro c045c341329ddcd83abe4adf12428e100b7a700a && git merge --no-ff a2519c047868b21653e0f91af041af35fcf3c846
node scripts/docs-audit/affected-docs.mjs --json c045c341329ddcd83abe4adf12428e100b7a700a
|
|
domain:server#5 · os-bill · session_01Utp6CYVV6fcAQrNTDQRvPb 维护者速读
席位意见:同意落地,作为 #30212 的一部分。补名放在插件里,走现有的 席位核对Head
|
Requested by Bill · project thread
domain:server#5 · os-bill · session_01Utp6CYVV6fcAQrNTDQRvPb
维护者速读
pnpm --filter @objectstack/plugin-email exec vitest run src/email-plugin.mail-settings.test.ts,预期 34 条全过,其中“sender display name follows the product name”一组 10 条。Part of #30212
Clause-②: no
Metadata-protocol: none — a server default changes (the sender's display name, and the Mail settings page's From name default); nothing a metadata author writes changes.
Skills-docs: none —
git grep -n -i -E "from_name|mail\.from|from name|sender name|defaultFrom|resetPasswordTokenExpiresIn|set-password link|60 minutes" -- skillsnames no sentence about the mail sender or the link lifetime (its one hit isdefaultFromRowinskills/objectstack-ui/rules/actions.md, an action-param key).Row 3 of the card. Row 2 (the bulk-import set-password link lifetime) is not in this PR: the seat ruled it out after the measurement (a credential-setting link's lifetime, the security seat vacant), so the card stays open for it. Rows 1 and 4 landed earlier.
What changes
@objectstack/plugin-email.EmailServicePluginnames a default sender that has no display name of its own with the product name the auth mails' subject and body already read: the Setup → Branding product name (branding.workspace_name) when an administrator SET one, else the deployment's name (defaultTemplateContext.appName, whichos serveresolves fromOS_APP_NAMEand the config chain), elseObjectStack. This is the chain plugin-auth binds to the auth mails'{{appName}}.kernel:readyand again on every Branding save, so a rename reaches the next mail with no restart. A manifest default is not taken for a set value. The namespace is bound only where the settings service lists it; a walled posture withholds it, and the deployment's name applies there.OS_EMAIL_FROMholding an address alone, orconfig.email.defaultFromwithaddressalone).default, or a boot-declared name. A sender a send passes asinput.from, and a template's own sender, are never renamed.EmailService's public surface is unchanged: the plugin installs the named sender through the existingsetDefaultFrom.@objectstack/service-settings.mail.from_namedrops itsdefault: 'ObjectStack': an unsaved field reads empty, and the resolver answersvalue: null,source: 'default', as Branding's product name already does. The field gains help text in en, zh-CN, ja-JP and es-ES saying that an empty value uses the product name. The Branding manifest's header names plugin-email as a reader ofworkspace_name.Tests
packages/plugins/plugin-email/src/email-plugin.mail-settings.test.ts, new top-level describe "sender display name follows the product name when none is set" in the existing harness (the harness's fake settings service now lists namespaces and serves abrandingsnapshot): Branding name set; Branding unset falls back to the deployment name; nothing configured givesObjectStack; an explicit From name wins; a From name that is only a manifest default does not; a Branding save and a Branding clear take effect without a restart; a boot sender without a name is named; a caller's ownfromis untouched; no Branding read under a walled posture; the test mail carries the name.packages/services/service-settings/src/manifests/mail.manifest.test.ts:from_namedeclares no default, stays optional, and carries the help text.Acceptance notes
ObjectStack, if a save sent the prefilled default) is an explicit value and keeps winning. Clearing the field makes the sender follow the product name.resolveEmailCapabilityArgbuilds when nothing declares one keeps its derived name (the deployment's name). Setup → Branding does not rename that one. It is the sender for a deployment with no From address configured anywhere.{{appName}}from the boot-time template context (the deployment's name), not from Setup → Branding. This PR does not change that. Only the auth mails read the Branding product name today.Verification
Head
a2519c047, merged withorigin/mainfa9c0aa2a(up to date).Tests and typecheck (both touched packages)
origin/mainfa9c0aa2a: the new describe ran 8 failed / 1 passed (the passing one is the control: a caller's ownfromis untouched); for example "expected 'no-reply@acme.test' to be 'Acme Portal (no-reply@acme.test)'", angle brackets spelled as parentheses here.pnpm --filter @objectstack/plugin-email testthentypecheckunder the verify lock: VERDICT command-exit 0; Test Files 48 passed (48), Tests 795 passed (795);check:test-typecheckOK.pnpm --filter @objectstack/service-settings testthentypecheckunder the verify lock: VERDICT command-exit 0; Test Files 68 passed (68), Tests 1157 passed (1157).pnpm exec eslint --no-inline-configon the 9 changed source files: exit 0. The repo-widepnpm lintis left to CI (Lint & Repo Gates).Ablation (once, through scripts/ablation-replace.mjs)
email-plugin.tsnamedSender: the line that keeps a sender's own name, replaced by an unconditionalreturn sender;(marker ABLATED-30212). Mutation landed (anchor 1 to 0, blob b4930823f853 to 6572e816ed05).vitest run src/email-plugin.mail-settings.test.ts: Tests 8 failed / 26 passed (the 7 naming pins plus the existing sys_email delivery pin that expects the named sender).git diff HEADempty, marker count 0. The tests importsrcdirectly, so no dist rebuild is involved.Derived gates (dispatch-gates --commands, reconciled with --ran)
pnpm check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET (it reads every package's built output; only this diff's closure is built here). Left to CI.node scripts/check-plugin-teardown-shape.mjs --self-testexited 3 on the shallow clone (its pinned fixture commit was missing); aftergit fetch origin 621a487607881c66b2899b7e3477115229a156b4it exited 0 (48 cases pass).--ranverdict: "60 derived famil(ies) accounted for, 59 run, 1 NOT-MEASURED". Changed lines 366 (+344 / -22), under the 3000 threshold.Generated by Claude Code