Repository navigation
fix(email): a log-only transport's send is recorded as logged, not sent - #39139
Conversation
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1
📓 Docs Drift CheckThis PR changes 4 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 190 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 b5d2a8bbe8058b5b7a66d85753b5797de07af197 && git checkout b5d2a8bbe8058b5b7a66d85753b5797de07af197
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0c45d66f793ecffcf7d7273abfdd5569aba143a7 093d6e79c11419bba753b99aac8acafed2e37411 && git checkout -B drift-repro 0c45d66f793ecffcf7d7273abfdd5569aba143a7 && git merge --no-ff 093d6e79c11419bba753b99aac8acafed2e37411
node scripts/docs-audit/affected-docs.mjs --json 0c45d66f793ecffcf7d7273abfdd5569aba143a7
|
|
repo:cloud#3 · zhuangjianguo · session_01TsNV8Bsjqmw7aXCo2QuLU1 Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Findings:
Tests: the three ablations in the PR body match the code read (the status choice, the terminal set plus the sweep branch, the union member). The Implemented-by: VERDICT: FAIL FAIL at this head: the widening itself is declared and built correctly, but four assertions in |
The rest send-door tests pin logged under the log provider. The Setup banner, the missing-API-key error and the env reference say logged. Send test email reads the send's own status. The terminal set is exhaustive by construction. The QA checklist oracles are updated, and the docs list is fixed. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1
|
repo:cloud#3 · zhuangjianguo · session_01TsNV8Bsjqmw7aXCo2QuLU1 Contract reviewServed-tier: ① Derived judgmentsDelta re-review of the record at
② Semver levelUnchanged: ③ Boundary flags
④ Design judgment
The exhaustive No finding blocks. Nits, none of them owed before merge:
Implemented-by: VERDICT: PASS PASS at this head on the contract: F1 to F6 are closed, F7 is carried as a cloud pin-bump note, and the rework adds no finding. This is not a statement that CI is green: 36 check-runs, all of |
|
repo:cloud#3 · zhuangjianguo · session_01TsNV8Bsjqmw7aXCo2QuLU1 席位核对 · ACCEPT · 2026-12-02T14:53ZHead:
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46912209833 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Fixes #39114
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
Ruling-ref: the maintainer, in the seat's session: 「39114 A」 (claim comment 7344600357) — a log-only transport's send is recorded with a new
EmailDeliveryStatusvalue,logged, notsentplus a flag.EmailDeliveryStatusgains'logged'.TransportSendResultgains an optionaloutcome?: 'logged': the transport's own typed statement that it only recorded the message. Absent means a real hand-off, so every existing transport is unchanged. The free-formresponsestring is never read for this.instanceof LogTransportand not theresponse: 'logged'text. It is per send, so a hot swap of the transport mid-send cannot mislabel the row. It is typed and closed. A third-party log-only or dry-run transport can say it too, which class identity cannot.LogTransport.sendanswersoutcome: 'logged'.EmailService.deliverNormalizedwritesstatus: 'logged'with the message id and nosent_at, and answersstatus: 'logged'. This coverssend,sendTemplate,sendInline, the outbox drain and the queue worker.statusselect onsys_emailandsys_identity_emailgainslogged (not delivered)(yellow). It is translated forsys_emailin all 11 shippedobjects.generatedbundles. The bundles carry nosys_identity_emailentries at all (onmaintoo), so that object shows the English label, like the rest of its fields.check:i18nreports in sync, with no stale-fill entry.TERMINAL_EMAIL_STATUSESincludeslogged. Without it, a logged row's out-of-row attachments stall and are never reclaimed.TERMINAL_EMAIL_STATUSESis now exhaustive by construction: asatisfiescheck against a Record keyed by everyEmailDeliveryStatusexceptqueued. Deletinglogged: truefails tsc with TS1360.loggedrow carries its message id, so the existingrow.message_idclause skips it.loggedapart fromsent:OutboxSweepResult.loggedand the summary line.result.status === 'logged', not frominstanceof LogTransport. Every reachable path answers the same as before: the press tests a built-in transport, or the live LogTransport.MAIL_DELIVERY_COPY.noMailText, all 11 locales) says messages are recorded as logged (not delivered), not as sent.capability-arg.ts) and theOS_EMAIL_API_KEYrow ofcontent/docs/deployment/environment-variables.mdx.isConfigured()stays on class identity. Theoutcomejsdoc and the changeset say so. A host-supplied transport answeringoutcome: 'logged'has its rows recordedlogged, butisConfigured()still answerstrue. Its readers are the messaging email channel's mount gate, the invitationlink_onlyanswer and the sign-up refusals.client.email.sendJSDoc namesloggedamong the statuses.status: 'sent'at the dev transport now saylogged:integration-system.email-template-renderacceptance[7], revision 18 to 19.identity-auth.self-service-password-resetfixtures.requires[0], revision 6 to 7.content/docs/kernel/runtime-services/email-service.mdx§ Returns. Theloggedparagraph sits after the field list.Reader census (the card's "consumers that count
sent")loggedhandlingemail.send.async)sent/message_idskip;failedthrows for retryloggedrow has a message id, so it is skipped and never retriedfailedvs everything elsestatus !== 'queued'failed; nowloggedresult.status === 'logged'for its warningPOST /email/sendlogged. Its own test (email-send-display-name.test.ts, real plugin with thelogprovider) pinnedsentin 4 cases, nowloggedloggedserve-email-capability.test.ts@objectstack/plugin-email, the declaration's home, socheck:test-source-aliasholdsctx.email.sendstatusthroughloggedfailedlink_onlyviaisConfigured)failedonlytransport_not_configured), so it never seesloggedsentstatus=queuedloggedis treated likesent(redactable): sensible, no changeTests
packages/plugins/plugin-email/src/email-service.test.ts, new top-level describe:send()throughLogTransportanswers and storeslogged, with the id and nosent_at.logged.responsetext is "logged" still recordssent.LogTransportunit test pinsoutcome.outbox-sweep.test.ts: aloggedrow is counted apart fromsent, and the summary line says so.attachment-reclaim.test.ts: aloggedrow is terminal and is reclaimed.email-plugin.queue-delivery.test.ts: the live-LogTransport test press used to pinstatus: 'sent', which was the defect. It now pinslogged.packages/rest/src/email-send-display-name.test.ts: four cases boot the real plugin with thelogprovider. They now pinlogged.packages/cli/src/commands/serve-email-capability.test.ts: the missing-API-key refusal now says "as logged".packages/spec/src/contracts/email-service.test.ts:loggedis in the union, andoutcomeis optional and closed. Both use@ts-expect-errorcontrols, and the file is compiled bytsconfig.test.json.Red on the unfixed code, and ablations
statusforced to'sent', which is the code before this PR):src/email-service.test.ts:Tests 2 failed | 73 passed (75).send() through the LogTransport ...:expected 'sent' to be 'logged'.the outbox-drain path ...:expected 'sent' to be 'logged'.git checkout HEAD.'logged'removed fromTERMINAL_EMAIL_STATUSESand the sweep'sloggedbranch:Tests 2 failed | 35 passed (37).expected 'stalled' to be 'reclaimed'.{ sent: 0, logged: 1 }.| 'logged'removed from the spec union:check:test-typecheck: 1 problem(s) — src/contracts/email-service.test.ts: 2 type error(s). Restored.logged: trueremoved from the terminal record: plugin-emailtsc --noEmitfails withsrc/attachment-reclaim.ts(109,3): error TS1360: Type '{ sent: true; failed: true; }' does not satisfy the expected type(the Record keyed by failed, sent and logged). Restored.Verification
Local runs (rework at head 093d6e7, merged with main at b512a7b; every heavy run through os-verify-lock)
test && typecheck:Test Files 54 passed (54),Tests 1058 passed (1058),check:test-typecheck: OK.VERDICT command-exit 0.test:Test Files 450 passed (450),Tests 9270 passed | 351 skipped (9621).VERDICT command-exit 0.serve-email-capability,serve-email-persist,serve-email-appname-precedenceandserve-stack-email-sms-door.contract, with verifyharness.served-composition:Tests 52 passed (52)andTests 10 passed (10),VERDICT command-exit 0.serve-email-capabilityTests 17 passed (17).typecheckeachVERDICT command-exit 0withcheck:test-typecheck: OK.test && typecheck(first round, unchanged since):Tests 2233 passed (2233).dispatch-gates --commandsderived 128 commands at 093d6e7, run with exit codes captured before any pipe.check:i18n,check:i18n-stale-fill,check:test-source-alias,check:slot-lookup, speccheck:skill-examples(after building client-react),check:api-surface,check:docs,check:liveness,check:nul-bytesandcheck:doc-authoring.check:platform-checklistexit 1:areas/dashboards.json: ABSENT SYMBOL setup-nav.contributions.ts#nav_system_overview. This comes from main at the merge base. Currentorigin/main(3dfffef) no longer carries that citation, and this PR touches neither file.check:dual-build-cjs-loadscheck:i18n-coveragedispatch-gates --ran:128 derived famil(ies) accounted for — 126 run, 2 NOT-MEASURED.--no-inline-config) on the rework's TS files: exit 0. Control-byte scan: no hits.Read first (by risk):
packages/plugins/plugin-email/src/email-service.ts, thedeliverNormalizedhunk: the one place a row's success status is chosen.packages/spec/src/contracts/email-service.ts: the contract widening.packages/plugins/plugin-email/src/attachment-reclaim.ts: the terminal set. A missed status here leaks storage.Two-minute check:
pnpm --filter @objectstack/plugin-email exec vitest run src/email-service.test.ts.logged, neversent" passes 3 of 3.Acceptance notes
sentbefore this release keep readingsent. No backfill: nothing on a row distinguishes them.IEmailService.isConfigured()still judges byinstanceof LogTransport. It is left as is, and theoutcomejsdoc and the changeset say so. It answers "will mail be delivered" for the service as a whole, not for one send.sys_identity_emailhas no translation entries in any bundle, before or after this PR. Its new option shows in English, as all its fields do.status: 'sent'on rows that a send with no provider configured wrote. cloud prose also says "recorded insys_emailas sent". Both go stale when cloud takes this commit; see review F7.Generated by Claude Code