Repository navigation
fix(messaging): a member's own "no digest" or "no quiet hours" beats the organization's default - #36326
Conversation
…he organisation default (#35123) Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-authored-by: Claude <noreply@anthropic.com>
…e unset-digest hook and the one-time conversion (#35123) Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-authored-by: Claude <noreply@anthropic.com>
…s in every locale (#35123) Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-authored-by: Claude <noreply@anthropic.com>
…ngeset (#35123) Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-authored-by: Claude <noreply@anthropic.com>
…registers the ledger (#35123) Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-authored-by: Claude <noreply@anthropic.com>
… engine; census recounted (#35123) Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 45 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 6 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 126eda98e7a8b51d4bc76bdc2e250a2ec3835c68 && git checkout 126eda98e7a8b51d4bc76bdc2e250a2ec3835c68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1cd47628e64beb49eec35ae77dcd3d049f5d010c 621aa11e59e26ee578e05d2a999f54a1b8a486a6 && git checkout -B drift-repro 1cd47628e64beb49eec35ae77dcd3d049f5d010c && git merge --no-ff 621aa11e59e26ee578e05d2a999f54a1b8a486a6
node scripts/docs-audit/affected-docs.mjs --json 1cd47628e64beb49eec35ae77dcd3d049f5d010c
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head declared (area a4-B) · 2026-11-22T06:45Z:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): REWORK, one item, waiting on the seat's answer at head 席位核对Shape and gates (
Against ruling B. Items 1 to 6 are built as ruled.
R1 (visible behaviour, so the seat's call; no code until it answers): an explicit "no quiet hours" also moves the member's digest to UTC midnight.
Next. The seat answers R1, and then a4-B makes the matching change. I read only that delta and give ACCEPT. After that, seat 7 runs the contract review, the seat adds the four pieces, and Leehom merges. |
…n the organization window's time zone (#35123) The digest took its time zone from the resolved quiet-hours row, so a member's own { off: true } (no window) moved their organization digest to 00:00 UTC. The digest zone now comes from the next channel-wildcard row in the walk that holds a window, past the explicit off; quiet hours stay off for the member, and with no window on any row the digest stays on UTC. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head declared (area a4-B, delta) · 2026-11-22T07:47Z:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对R1 (digest time zone after an explicit "no quiet hours"): closed, as the seat chose (b) at 06:49Z.
Gates at this head: 62 success, 11 skipped, 0 failed. The full read in 7075548155 stands for everything else. Next. Seat 7 runs the contract review. Then the seat adds the four pieces and the maintainer merges. |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head for seat 7 L2 · 2026-11-22T07:50Z: |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head 621aa11 · 2026-11-22T08:04Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Read: card #35123 body and all 14 comments (rulings 6996036362 and 7073270426, forks 7073149058 and 7073430021, dev reports 7075210312 and 7076099772, claim revisions), PR #36326 body and all 8 comments (L1-a REWORK 7075548155, L1-a ACCEPT 7076146202), the net diff ① Derived judgmentsThe question is whether
S1 (should-fix) — the one-time conversion can rewrite a ② Semver level
③ Boundary flags
No must-fix. One should-fix (S1), non-blocking and carried on a follow-up card. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv 席位核对Awaiting the maintainer's merge (builds ruling 7073270426) · 2026-11-22T08:18Z · head
|
Requested by Leehom · project thread
Fixes #35123
Clause-②: no
Metadata-protocol: none
Ruling: 7073270426 on #35123 (maintainer, verbatim: 「B 没设的项继续跟随组织」), building ruling 6996036362 (「成员自己的选择优先」); interim hook per the seat's answer to fork 7073430021, F1 carried by #36245.
维护者速读
What changes
Ruling 7073270426 (report letter B): a notification preference's
digestandquiet_hoursare each three states in storage, and one rule decides them. The most specific preference that sets a field decides it. A preference that leaves a field empty decides nothing for that field, so the walk goes on: the person's topic row, then their own wildcard row, then the organization's default, then the built-in default.digestquiet_hoursnone{ "off": true }daily/weekly{ tz?, start, end }notification-preference.object.ts):digestlosesdefaultValue: 'none', so a row nobody chose a digest for stores empty, and a storednoneis the explicit "send each one right away" its description already promised. Both field helps now state the three states, in all 11 locales.preference-resolver.ts):parseDigestadmitsnoneas a decision.parseQuietHoursreads{ off: true }as the explicit off, andoff: truewins over any other key.resolveDigestandresolveQuietHoursstop at the first row that sets the field (!== undefined) rather than at the first truthy value. The door (effectiveFor) answers a member's explicit off as{ value: 'none' / null, source: 'own' }.preference-digest-conversion.ts, wired atkernel:ready): every storeddigest = 'none', in every organization, becomes empty, ONCE. Before this release a storednonenever took effect, so no one's effective digest changes at upgrade. Run-once route: asys_migrationledger row (messaging-preference-digest-none-unset), read and written through the engine, withDATA_MIGRATION_FLAG_OBJECTimported from@objectstack/spec/systemand the id spelled locally.plugin-auth'smembership-backfill-ledger.tsis the precedent. The row is CLAIMED before the first rewrite, so no later boot runs again, whatever fails mid-pass. Each rewrite is a compare-and-set (where: { id, digest: 'none' }, multi: true), so a value written since the read is left alone. With no ledger on the kernel, or a ledger it cannot read, the pass does not run and says so atwarn. Per-row failures are named aterrorwith the fix. ⛔ It is deliberately NOT the every-boot shape ofpreference-user-conversion.ts: after this release anoneis a real choice, and an every-boot pass would erase it.myPreferences.ts,NotificationSettingsPage.tsx): "No digest" (不汇总) is always offered and savesnone. Clearing the quiet-hours window and pressing Save stores{ off: true }, never empty. A half-filled window still cannot be saved. ThedigestNoOffandquietHoursNoClearnotes are removed from all 11 locale bundles. The quiet-hours control (ui/packages/fields) is untouched: the page never hands it the marker, because the door answers an explicit off asnullwithsource: 'own'.content/docs/data-modeling/field-types.mdxstates the three states and the rule once.Why
{ "off": true }for "no quiet hours, by choice" (for the contract review){}.{}andnullare what a cleared widget or an API caller writes for each other. One written for the other would silently turn "off" back into "follow the organization". Nothing produces{ off: true }by clearing something.parseQuietHoursparses strings) covers it unchanged.ui/packages/fieldsreadQuietHoursalready reads any unknown key asunreadable: it shows the value as stored and never rewrites it unless the person replaces it. So the Setup grid cannot silently drop it.off: truereads as "off" in a raw row, an export or an audit diff, where{}reads as "nothing".off: truewins over anystart/endbeside it. Mixing them is not a supported write, but if it happens it reads as the stronger statement.Deviations
preference-digest-unset.ts, bound inmessaging-service-plugin.ts). A SQL database created by an earlier release keeps the old physical column default (digest varchar(255) default 'none'), and schema sync never retrofits a column default on an existing table. On such a database, an insert that omitsdigestwould getnonefrom the database, which now means the member's explicit "no digest". The hook writesdigest: nullon every insert that leaves it unset, so the database default never fires. It comes out in the change that lands schema sync: removing a literal defaultValue from a field leaves the physical column DEFAULT on every SQL database an earlier release created, so unset writes keep storing the old default #36245, and the code comment says so.noneon a database that carries the legacy column DEFAULT. That covers raw SQL and a bulk load straight into the table. Such anonereads as the person's explicit "no digest" until schema sync: removing a literal defaultValue from a field leaves the physical column DEFAULT on every SQL database an earlier release created, so unset writes keep storing the old default #36245 lands.docs/audits/2026-08-tenant-audit-write-call-sites.counts/services/service-messaging.md, regenerated bynode scripts/tenant-audit-census.mjs --writefor the three new write call sites (the gate's own fix line). It also touches the 11service-messaging*.objects.generated.tsbundles:enwas regenerated bycheck-i18n-bundles.mjs --write, and the 10 translated helps were extended by hand.packages/spec/**is untouched.digestselect still accepts the same three values,quiet_hourswas already free JSON, and no export is added to or removed from the package index (the new modules are internal). The meaning of a storednonechanges, which the one-time conversion covers. Metadata-protocol: none, becausesys_notification_preferencerows are data, not authored metadata.{ off: true }), the digest takes its time zone from the next preference row in the walk that holds a quiet-hours window (normally the organization default), so it still flushes at midnight in that zone (for example Europe/Berlin); with no window on any row it stays on UTC (L1 R1 7075548155, fix b, at621aa11e59; pinned inpreference-resolver.test.tswith a UTC control, ablation red then restored). ADR-0030 l.93-94 still reads true: the digest still takes aquiet_hours.tz, now from the nearest row that holds a window.Tests
Pins (service-messaging, app-shell) at 1c5040c
preference-resolver.test.ts(fake engine), new describe "a member's explicit off beats the organization default":nonebeats an orgdailydefault, and an orgweeklydefault (it.each);{ off: true }beats the org window, including when the column holds it as a JSON string;null,undefinedor''follows the org default, and{}is not the off;org_a(opted out) andorg_b(unset):org_bkeeps the digest.preference-digest-three-states.integration.test.ts(realObjectQL+SqlDriverbetter-sqlite3 FILE database; boot 1 with the legacy object, boot 2 with the new one, same file):null(the premise is asserted first: boot 1 storesnone); an explicitnonestaysnone;noneinorg_aandorg_b, including an org default row, leavesdailyalone, and recordssys_migrationwith{ status: converted, converted: 3, failed: [] }, with no error logged;nonewritten after the conversion is stillnoneafter a second boot (already-run), both an updated row and a fresh insert;effectiveFor) answers the member's explicit off asown, and a member row that leaves both unset follows the org (default).myPreferences.test.ts/NotificationSettingsPage.test.tsx: "No digest" is offered while an org digest is in force and savesdigest: 'none'; a cleared window savesquiet_hours: { off: true }; a half-filled window cannot be saved.Runs, under the verify lock:
pnpm --filter @objectstack/service-messaging exec vitest run --maxWorkers=2: VERDICT command-exit 0, Test Files 80 passed (80), Tests 1075 passed (1075).pnpm --filter @objectstack/service-messaging typecheck: exit 0.pnpm --filter @object-ui/app-shell exec vitest run --root ../.. --maxWorkers=2 packages/app-shell/src/console/notification-settings: Test Files 3 passed (3), Tests 46 passed (46).pnpm --dir ui exec vitest run --maxWorkers=2 scripts/: Test Files 172 passed, 2 skipped (174).Ablations: each pin's subject mutated through scripts/ablation-replace.mjs (WRAP mode, run under the lock), each restored to the HEAD blob with an empty git diff HEAD
parseDigestadmitsnone→ removedparseQuietHoursoff: trueline deletednone(null/''→'none')data.digest = nulldeleted'ablated-' + startedAt)tenantId: 'org_a'quietHoursStored(null)returns the draft{ off: true }(unit), cleared window saves the off (page)digestChoicesdropsnoneThe service-messaging subjects are imported from
srcby relative path, so nodist/was involved; the app-shell subjects likewise. A8's first attempt was NOT MEASURED (lock queue-timeout 99) and was re-run with the result shown.Acceptance notes
messaging-service-plugin.test.ts's boot tests (green), not by a dedicated pin. The pins drive the modules directly.nonewritten between those boots would then be converted. This is logged aterrorwith the fix.nonerows), plus the optional "follow the organization again" page action and the sharedQUIET_HOURS_OFFspelling.Verification
packages/services/service-messaging/src/preference-digest-conversion.ts(the run-once claim and the compare-and-set),packages/services/service-messaging/src/preference-resolver.ts(parseDigest/parseQuietHoursand the two walks),packages/services/service-messaging/src/preference-digest-unset.ts(the temporary hook).pnpm --filter @objectstack/service-messaging exec vitest run --maxWorkers=2 src/preference-digest-three-states.integration.test.ts src/preference-resolver.test.ts, expect 2 files and 42 tests green, including "a none written after the conversion is still none after a second boot".Local gates (dispatch-gates --commands at 1c5040c, 109 commands)
node scripts/pm/dispatch-gates.mjs --commands: 109 derived. At 1c5040c, 105 ran in one pass with each exit code captured before any pipe: all exit 0. Four ran on their own:pnpm --dir ui exec vitest run scripts/(under the lock, maxWorkers=2) exit 0, 172 passed and 2 skipped;pnpm --filter @objectstack/spec run check:skill-examplesexit 0 after building the client-react closure;pnpm check:type-check-debtexit 0;pnpm check:dual-build-cjs-loadsUNRUN.--ranreconciliation: 109 derived, 108 run, 0 NOT-MEASURED, 1 UNRUN (check:dual-build-cjs-loads). That is a declared narrowing: its prerequisite is a fullpnpm buildof the monorepo, so the CI Lint and Repo Gates job carries it.check:tenant-audit-census(census regenerated),check:engine-double-contractandcheck:objectql-double-limit(the doubles were replaced by a real engine in the integration file).node scripts/check-platform-checklist.mjs --changed-from origin/main: exit 0.check:i18n: in sync.type-check, because the ui closure was not built (the unresolved modules are the@object-ui/*packages). The only notification-settings diagnostic is the existingapiFetchline, unchanged from origin/main. CI Type Check UI carries it.Generated by Claude Code