Repository navigation
fix(plugin-approvals): a new delegation starts with the Delegator set to you, and its help says why - #25420
Conversation
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy
…locale; changeset Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy
📓 Docs Drift CheckThis PR changes 1 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 — 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 eb119acb1597cd01eef3e947253426960140c412 && git checkout eb119acb1597cd01eef3e947253426960140c412
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f0fdd45bbc83f13d35af54f1ec903320340617c1 4194149960094594115e755890af323d69766d47 && git checkout -B drift-repro f0fdd45bbc83f13d35af54f1ec903320340617c1 && git merge --no-ff 4194149960094594115e755890af323d69766d47
node scripts/docs-audit/affected-docs.mjs --json f0fdd45bbc83f13d35af54f1ec903320340617c1
|
席位核对 · ACCEPT · 2026-10-23T13:14Z
Generated by Claude Code |
Requested by Sales · project thread
Fixes #25342
Clause-②: no
Metadata-protocol: none
What
Setup → Delegations (OOO): the Delegator of
sys_approval_delegationonly ever offers the signed-in user, becausebindDelegationWriteGuardadmits nobody else. The field still opened at "Select…", and a search for a colleague answered "No options found" with no reason.delegator_idnow declaresdefaultValue: 'current_user'. A new delegation starts with its one admissible Delegator filled in.lookupFilters, the write guard and the approval-service filter are unchanged.organization_idis not touched; queued plugin-approvals: an approval delegation with no organization still applies across every tenant (the retired NULL-means-global reading, ADR-0131) #25280 edits that field's help.Why this spelling
I checked how the platform defaults a person field to the current user, on
origin/main830a63a680:packages/spec/src/data/field.zod.tsdefaultValuesayscurrent_useris legal "onuserorlookupwithreference: 'sys_user'only". The spec's token table isdefaultValueTokenIssueinpackages/spec/src/data/default-value-shape.ts, and the constant isDEFAULT_VALUE_TOKEN_CURRENT_USERindefault-value-tokens.ts.packages/objectql/src/engine.ts, theisCurrentUserDefaultTokenbranch of the field-default pass. With no authenticated user it leaves the field unset.examples/app-showcase/src/data/objects/field-zoo.object.tsf_owner(Field.user({ defaultValue: 'current_user' })). No other platform object defaults a lookup to the current user, so this is the first such platform field. It uses the spelling the spec, the engine and the docs (content/docs/data-modeling/field-types.mdx) all name.packages/specis not edited.Translations
enwas regenerated withnode scripts/check-i18n-bundles.mjs --write.es-ESandja-JPwere byte copies of the old English help. They now carry translations, and the next extract dropped their twosource-hashesentries.zh-CNalready had a translated help, so I updated it to the new meaning too. It has no hash entry, so nothing would have flagged it as stale.Tests
packages/plugins/plugin-approvals/src/sys-approval-delegation-delegator-picker.test.tskeeps every existing pin. It gains one for the default: the declaration and the registered body carryDEFAULT_VALUE_TOKEN_CURRENT_USER, and a fullFieldSchema.safeParseof the field is green, so the spec admits the token on this lookup.pnpm --filter @objectstack/plugin-approvals test: Test Files 94 passed (94), Tests 1215 passed (1215).pnpm --filter @objectstack/plugin-approvals typecheck: exit 0.check:test-typecheckreports OK.defaultValue: 'current_user',(scripts/ablation-replace.mjs, anchor x1 -> x0) turned the new pin red (expected undefined to be 'current_user', 1 failed | 9 passed). The file was restored to its HEAD blob andgit diff HEADwas empty. The test imports the object fromsrc/, so no build was needed. My first attempt was a refused anchor miss, so nothing ran on it.Acceptance notes
current_userdefault. The server side is pinned. If the console does not prefill from this token, that gap belongs to objectui and would hit the showcasef_ownerfield too. It is not a reason to change the spelling here.requiredrefuses it, and the existing pin holds that.🤖 Generated with Claude Code
https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy