Repository navigation
Commit 64c4285
fix(plugin-email): a host's own mail transport reads as in use on GET /api/settings/mail (#34731)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9SCDb2wCYDLuCsxUCkbNfGs)_
Fixes #32799
Clause-②: yes (widening) — the served `live` entry of `GET
/api/settings/:namespace` now also admits `{ value: null, source:
'environment' }`; every entry served before is served unchanged
Metadata-protocol: none
## 维护者速读
- **改了什么:** 宿主交给 plugin-email 的自带投递方式(选项表叫不出名字,比如托管平台代发通道),现在在 `GET
/api/settings/mail` 上报为 `live.provider = { value: null, source:
'environment' }`,即「在用、来自运行环境、选项表叫不出名」。spec 只改 `live`
的说明文字(形状不变),service-settings 判定放行 `environment + null` 这一种组合。
- **为什么改:** 按裁决 C(6942903820)。托管环境邮件一直在发,但设置清单读不到,邮件行显示未完成。
- **风险与回滚:** 低。只多放行一种组合;`settings + null`、无选项表的键照旧丢弃;内置
smtp/resend/postmark 读数不变。回滚即 revert 本 PR。控制台 `isMailDelivering` 目前把
`environment + null` 读成未完成,要等 ui 跟进卡 #34749 才会打勾。
- **先看:**
`packages/services/service-settings/src/settings-service.ts`(`judgeLiveValue`
新增一行)、`packages/plugins/plugin-email/src/live-transport-status.ts`(新增一个分支)、`packages/spec/src/system/settings-manifest.zod.ts`(`live`
说明)。
- **两分钟验证:** `pnpm --filter @objectstack/plugin-email exec vitest run
src/live-transport-status.pin.test.ts`,预期 21 个通过,其中「environment: the
host's own transport …」一条读到 `{ value: null, source: 'environment' }`。
- **需要你做的:** 待契约复审(L2)通过后,由席位请你批准这个 spec 面 PR。
## What changes
- **`@objectstack/spec`** — `SettingsNamespacePayloadSchema.live`: the
docblock and the `value`/`source` describes now say a non-null `value`
is one of the key's options, and `value` is `null` under `'none'`
(nothing in use) or `'environment'` (in use, supplied by the boot
environment or host, named by no option). In-use is read from `source`,
never from `value === null`; `'settings'` always names an option. Shape
unchanged. Generated
`content/docs/references/system/settings-manifest.mdx` regenerated.
- **`@objectstack/service-settings`** — `judgeLiveValue` serves `{
value: null, source: 'environment' }`. `settings` + `null` and any entry
on a key with no option table stay dropped. `SettingsLiveValue` /
`SettingsLiveStatus.values` docs follow.
- **`@objectstack/plugin-email`** — `describeLiveMailTransport` states
`{ value: null, source: 'environment' }` for an `environment`-origin
transport no `provider` option names (a plain `IEmailTransport` the host
hands over). Stock transports read as before; a transport swapped in
through `setTransport` is still not stated; a `settings` origin with no
option is still not stated.
- Root changeset
`.changeset/32799-host-mail-transport-live-environment.md` (patch × 3).
## Tests
- `packages/plugins/plugin-email/src/live-transport-status.pin.test.ts`
— **changed existing test**: "states nothing for a transport no option
names, or one this plugin did not install" split in two. The
host's-own-transport half now asserts `{ value: null, source:
'environment' }` through the served door (real `SettingsService` + mail
manifest, body parsed by `SettingsNamespacePayloadSchema`), as ruling C
requires. The swapped-transport half keeps "not stated", plus a host-own
transport swapped through `setTransport`. New unit pin: a no-option
transport is stated only under `environment` (not `settings`, not
without an origin).
-
`packages/services/service-settings/src/settings-routes.live-status.pin.test.ts`
— new: `environment` + `null` served on the mail page with no warn; new
drop row: a key with no option table as `environment` + `null`. The
existing `settings` + `null` drop row is relabelled ("no value under
source \"settings\"").
- `packages/spec/src/system/settings-manifest.test.ts` — the payload
parses `environment` + `null`.
## Acceptance notes
- Console follow-up owed (`domain:ui`, not in this claim, ruling C's "另立
ui 卡"): `ui/apps/console/src/pages/settings/firstRunChecklistLogic.ts`
`isMailDelivering` treats `environment` as done only with a non-empty
string `value`, so `{ value: null, source: 'environment' }` reads not
done (before this PR the absent statement fell back to
`isMailConfigured(values)`).
`ui/apps/console/src/pages/settings/types.ts` still documents "`null`
exactly when `source` is `'none'`". Filed #34749.
## Verification
At head `9e70d11b5a453c4a787655c649a0284c4f29f896` (merge base
origin/main `dc66d330`); full report: card comment 6944198803.
- Package suites under `os-verify-lock`: `@objectstack/service-settings`
76 files / 1516 passed; `@objectstack/plugin-email` 54 / 1025 passed;
`@objectstack/spec` `src/system` 73 / 2577 passed.
- Typecheck: spec, service-settings, plugin-email exit 0.
- `dispatch-gates --commands` derives 117; `--ran`: 117 run, 0
NOT-MEASURED, 0 UNRUN.
<details><summary>Ablations (scripts/ablation-replace.mjs; each restored
blob == HEAD, git diff HEAD empty)</summary>
- Judge line `if (source === 'environment' && value === null) …`
removed: service-settings pin 1 failed / 23 passed. The plugin-email
pins resolve the service-settings dist built before the mutation, so no
dist leg was taken there.
- plugin-email branch `else if (!option && origin === 'environment') …`
removed: plugin-email pin 2 failed / 19 passed (the unit pin and the
served-door pin).
</details>
<details><summary>Gate re-runs</summary>
The first pass ran beside a locked build on a shared box. Four commands
were non-zero and each passed when re-run: `check-plugin-teardown-shape
--self-test` exited 3 until the pinned commit was fetched; spec
`check:generated` and spec `typecheck` hit a tsc out-of-memory and
passed alone; `check:skill-examples` and `check:dual-build-cjs-loads`
exited 3 (no built dist) and passed after a turbo build of
`./packages/**`.
</details>
CI at this head: 68 check-runs, 58 success, 10 skipped, 0 failed.
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmTBjYWuaUonx8DhAbB -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0afe509 commit 64c4285
9 files changed
Lines changed: 110 additions & 25 deletions
File tree
- .changeset
- content/docs/references/system
- packages
- plugins/plugin-email/src
- services/service-settings/src
- spec/src/system
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
| 180 | + | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
| |||
342 | 351 | | |
343 | 352 | | |
344 | 353 | | |
345 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
346 | 357 | | |
347 | 358 | | |
348 | 359 | | |
349 | | - | |
350 | | - | |
351 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
352 | 366 | | |
| 367 | + | |
353 | 368 | | |
354 | 369 | | |
355 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
356 | 376 | | |
357 | 377 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | | - | |
49 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
338 | | - | |
339 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
340 | 347 | | |
341 | 348 | | |
342 | 349 | | |
| |||
356 | 363 | | |
357 | 364 | | |
358 | 365 | | |
| 366 | + | |
359 | 367 | | |
360 | 368 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
166 | 180 | | |
167 | 181 | | |
168 | 182 | | |
| |||
204 | 218 | | |
205 | 219 | | |
206 | 220 | | |
207 | | - | |
| 221 | + | |
| 222 | + | |
208 | 223 | | |
209 | 224 | | |
210 | 225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
2279 | | - | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
2280 | 2282 | | |
2281 | 2283 | | |
2282 | 2284 | | |
| |||
2319 | 2321 | | |
2320 | 2322 | | |
2321 | 2323 | | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
2322 | 2328 | | |
2323 | 2329 | | |
2324 | 2330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
507 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
508 | 509 | | |
509 | 510 | | |
510 | 511 | | |
| |||
517 | 518 | | |
518 | 519 | | |
519 | 520 | | |
520 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
521 | 527 | | |
522 | 528 | | |
523 | 529 | | |
524 | | - | |
525 | | - | |
526 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
527 | 533 | | |
528 | 534 | | |
529 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
798 | 801 | | |
799 | 802 | | |
800 | 803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
972 | | - | |
973 | | - | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
974 | 980 | | |
975 | 981 | | |
976 | 982 | | |
977 | 983 | | |
978 | 984 | | |
979 | | - | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
980 | 989 | | |
981 | 990 | | |
982 | | - | |
| 991 | + | |
983 | 992 | | |
984 | 993 | | |
985 | 994 | | |
| |||
0 commit comments