Repository navigation
fix(spec,messaging): a push device's locale is described as stored, not as the language pushes render in - #30544
Conversation
… not the device's locale Claude-Session: https://claude.ai/code/session_01Utp6CZqHFs5GUFFGRbLgxy Co-authored-by: Claude <noreply@anthropic.com>
…y it Claude-Session: https://claude.ai/code/session_01Utp6CZqHFs5GUFFGRbLgxy Co-authored-by: Claude <noreply@anthropic.com>
…hangeset Claude-Session: https://claude.ai/code/session_01Utp6CZqHFs5GUFFGRbLgxy 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:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 171 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 87de9999ff6e142a778ad84f397f8dc9299c6bf2 && git checkout 87de9999ff6e142a778ad84f397f8dc9299c6bf2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c045c341329ddcd83abe4adf12428e100b7a700a e541b372168ff17a3d29f8cac8879df3afb8c1ac && git checkout -B drift-repro c045c341329ddcd83abe4adf12428e100b7a700a && git merge --no-ff e541b372168ff17a3d29f8cac8879df3afb8c1ac
node scripts/docs-audit/affected-docs.mjs --json c045c341329ddcd83abe4adf12428e100b7a700a
|
|
domain:server#4 · os-bill · session_01Utp6CZMkHvuDeVYgTD73qF CI note (seat). |
|
domain:server#4 · os-bill · session_01Utp6CZMkHvuDeVYgTD73qF 维护者速读
席位意见:ACCEPT(#29818)。推送设备「语言」字段的说明现在与实际一致:推送用收件人账号的语言,设备语言只是记录下来。行为不变,只是不再误导对接方。 席位核对Head-sha:
|
Requested by Bill · project thread
domain:server#4 · os-bill · session_01Utp6CZMkHvuDeVYgTD73qF
维护者速读
locale的三处描述(设备 schema、设备注册请求、sys_user_device.locale字段及其四种语言的帮助文字)改成如实说法:它只随设备保存,推送不按它渲染,推送用收件人的语言(用户语言,其次部署默认)。packages/spec/src/system/push-device.zod.ts(locale 一行)、packages/spec/src/api/protocol.zod.ts(RegisterDeviceRequest.locale 一行)、packages/services/service-messaging/src/keyed-notification-text.integration.test.ts(末尾新 describe)。pnpm --filter @objectstack/service-messaging exec vitest run src/keyed-notification-text.integration.test.ts,预期 20/20 通过,其中 3 条是新钉的"推送按用户语言而非设备语言"。Fixes #29818
Clause-②: no
Metadata-protocol: none
What changes
UserDeviceSchema.locale(packages/spec/src/system/push-device.zod.ts): was "Device locale … that pushes to this device are rendered in". Now: stored for the device, as the registration named it; no push renders by it; a push arrives in the recipient's language (sys_user.locale, then the deployment default).RegisterDeviceRequestSchema.locale(packages/spec/src/api/protocol.zod.ts): the same promise in the request contract a client sends, corrected the same way. Scope extension approved by the seat (14:22Z): the dispatch named one spec description; this twin carries the identical wording and defect, so it rides in this PR.sys_user_device.localefield description (packages/services/service-messaging/src/objects/user-device.object.ts) says the same; the messaging i18n bundle'shelpfor that field is regenerated inen(check-i18n-bundles --write) and its hand-writtenzh-CN/ja-JP/es-EStranslations are rewritten to the new meaning (they otherwise kept translating the old promise). Declared to and approved by the seat.content/docs/references/api/protocol.mdx,content/docs/references/system/push-device.mdx(gen:docs). No other spec artifact moved (check:generated14/14 current).patchfor@objectstack/specand@objectstack/service-messaging(Metadata-protocol: none).pushrow inTEMPLATE_CHANNELS, no per-device rendering.Tests
A new top-level
describeinkeyed-notification-text.integration.test.ts(the shared keyed-text harness: realObjectQLoverSqlDriver/better-sqlite3, the kernel's in-memory i18n, the realMessagingService), adding the real push channel over the real device registry (sys_user_device) on a push-service double that records each token's title and body. Each recipient's phone is registered with a locale that is not the recipient's: thezh-CNuser's phone inen, theenuser's phone inzh-CN, the no-locale user's phone inja-JP.zh-CNuser's phone gets thezh-CNsentence, theenuser's phone the English one, and the no-locale user's phone the deployment default's (zh-CN), notja-JP;Measured on
main(fa9c0aa) before any description change: the test was green, so the card's premise holds (pushes render by the recipient, never the device).Acceptance notes
textmember (packages/spec/src/api/push-relay.zod.ts:78) also says the line is shown "in the device locale". No producer of it lives in this repository (the relay is cloud's), so nothing here was measured against it; untouched, carrier: cloud.Verification
All readings at
e541b3721(head;origin/mainwas stillfa9c0aa2, so the merge was a no-op).Tests
pnpm --filter @objectstack/service-messaging test: Test Files 66 passed (66), Tests 815 passed (815);typecheckexit 0 (lock VERDICT command-exit 0).pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2: Test Files 905 passed (905), Tests 27161 passed, 1 todo (lock VERDICT command-exit 0).keyed-notification-text.integration.test.ts20/20, first green onmain's code before any description edit (commit8ab75e9f).Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 107 families; each run with its exit recorded before any pipe;--ran: 107 accounted, 106 run, 1 NOT-MEASURED.pnpm check:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: needs every package'sdist/; left to CI).check-plugin-teardown-shape --self-testandcheck:skill-examplesexited 3 (shallow history;@objectstack/clientandclient-reactnot built); both re-run green after the prerequisite (git fetchof the fixture commit; building those two packages).pnpm --filter @objectstack/spec check:generated: all 14 artifacts current.node scripts/check-i18n-bundles.mjs --write: exit 0, moved onlyen.objects.generated.ts.pnpm lint: exit 0.Generated by Claude Code