Repository navigation
Commit 8878c36
fix(service-messaging): Notification Preferences says which topics and channels can be entered (#25449)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuRnMeoGgdWq8MSdroEhKis3)_
Fixes #25346
Clause-②: no
Metadata-protocol: none
Claim of record: `6365308855` on the card (card thread,
`domain:services` seat 1). Ruling of record: `6365616409` (letter **A**,
Sales, on the needs_decision in os-dev-report `6365345478`). Branch
`claude/project-thread-8hqiya` is the harness-pinned branch for this
session. It names no issue, so the Duplicate Fix Guard's branch-name
hint will not match, and the claim is the identity record.
## What changes
Setup → Notification Preferences showed Topic and Channel as bare text
boxes. Their help only said "Notification topic" and "Channel id
(inbox/email/push/…)", and no `push` channel exists. The card asked for
pickers wherever the platform can enumerate the values. The measurement
in the report found that neither field can be a picker without a
contract change:
- **Topics.** A topic is whatever string the sender writes, and nothing
registers topics.
- **Channels.** Channels are registered at runtime through an open seam:
`MessagingChannel` is exported, and `registerChannel` is public. A
`select` does not fit:
- it is closed on the write path;
- its option values are `SystemIdentifierSchema`, so the stored `*`
wildcard cannot be an option.
Ruling A keeps both fields as `text` and makes the help say what to
type.
`packages/services/service-messaging/src/objects/notification-preference.object.ts`:
- **Channel help:** `inbox` (always available), `email` (once an email
service is configured), `sms` (once an SMS service is configured), or
the id of a channel an installed plugin adds. Enter `*` for all
channels. An id no channel uses matches nothing. `push` is gone.
- **Topic help:** the topic a flow's notify step names, or one the
platform sends, such as `approval.requested` or `collab.mention`. Enter
`*` for all topics. A topic nothing sends matches nothing.
The type, default (`*`), `maxLength`, index and resolver are unchanged.
No stored row changes meaning and no write is newly refused.
The comments beside both declarations record why the field is not a
picker.
Translation bundles:
- `en` was regenerated by `node scripts/check-i18n-bundles.mjs --write`.
- `zh-CN`, `es-ES` and `ja-JP` were translated by hand. The es-ES and
ja-JP leaves were byte copies of the old English source, which
`check:i18n-stale-fill` reds on. Re-translating them dropped their two
entries from each `*.source-hashes.generated.ts`, as the tool writes it.
## Pins
New file
`packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts`,
3 cases:
- **Both fields stay free text.** Each is `text` with default `*`, and
its help says `Enter * for all`.
- **The channel help names exactly the built-in channels.** The pin
compares it with the `id`s read from the three channel factories this
package builds (`createInboxChannel`, `createEmailChannel`,
`createSmsChannel`). So a channel added or renamed here fails until the
help says so. The help names none of the spec vocabulary's ids that no
channel implements (`push`, `webhook`, `slack`, `teams`, `in-app`), and
it says a plugin's own channel is valid.
- **The topic help says where a topic comes from.** It names the notify
step and an example topic.
**Ablation leg:** the object file was restored from `f0fdd45b` (base)
and the pin file run: 3 failed. HEAD: 3 passed. The file was restored
with `git checkout HEAD --`, and `git diff --quiet HEAD` passed. No
`dist/` leg is needed, because the pin imports source.
## Tests and gates
Read on `2d1b522b`. Then `main` was merged in, giving head `ad7975f4`.
None of the 7 incoming commits touches a `service-messaging` path, so
nothing was re-run.
- **Package tests:** `pnpm --filter @objectstack/service-messaging
test`: `Test Files 61 passed (61)`, `Tests 729 passed (729)`.
- **Type check and lint:** `pnpm --filter @objectstack/service-messaging
typecheck`: exit 0. `eslint` on the two changed source files: exit 0.
- **Derived gates:** `node scripts/pm/dispatch-gates.mjs --commands`
derived 68 commands, and all 68 exit 0. Three needed a prerequisite
first:
- `check-plugin-teardown-shape --self-test` ran after its pinned fixture
commit was fetched;
- `check:dual-build-cjs-loads` ran after the 8 dists it named were
built;
- `check:i18n-stale-fill` ran after the es-ES and ja-JP re-translation.
- **`--ran` reconcile:** `68 derived, 68 run, 0 NOT-MEASURED, 0 UNRUN`.
- **Not run locally, declared to CI:** the type-check lanes and the
path-scheduled CI jobs. No dogfood battery is owed: there is no `!` in
the title and no `(narrowing)` arm.
## Acceptance notes
- The card's "Done when" asks for pickers wherever the platform can
enumerate the values. Per the ruling, neither field gets one. A real
dropdown over an open vocabulary would need a spec-lane suggestion list
on text fields (the report's option C). That is not part of this card
and is not filed by it.
- The help also says a plugin's own channel id is accepted, and that a
value nothing uses matches nothing. Both describe today's behaviour,
within ruling A.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01GsN1y3qWPdkVLasbhDB2Fy)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01GsN1y3qWPdkVLasbhDB2Fy
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b2c0752 commit 8878c36
9 files changed
Lines changed: 124 additions & 14 deletions
File tree
- .changeset
- packages/services/service-messaging/src
- objects
- translations
| 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 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 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 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
| |||
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
150 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
151 | 170 | | |
152 | 171 | | |
153 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
110 | | - | |
111 | 109 | | |
112 | 110 | | |
113 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| |||
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
109 | | - | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
0 commit comments