Repository navigation
Commit 4be0868
fix(plugin-sharing):
Fixes #19258
Clause-②: no
`sys_sharing_rule.recipient_id` declared `dependsOn: ['recipient_type']`
while its `recipient-picker` widget reads **two** siblings. It now
declares both.
## The three readings, taken first-hand on today's head (`4045781fa`,
worktree base)
| # | reading | value |
|:--|:--|:--|
| 1 | `recipient_id.dependsOn` before this PR —
`packages/plugins/plugin-sharing/src/objects/sys-sharing-rule.object.ts:197`
| `['recipient_type']` |
| 2 | **control, same file**, `criteria_json.dependsOn` at line 156, for
its `filter-condition` widget | `['object_name']` |
| 3 | the widget's sibling reads — objectui
`packages/fields/src/widgets/RecipientPickerField.tsx:150,152` |
`dependentValues.recipient_type` **and** `dependentValues.object_name` |
Reading 2 is the judgement: the key is live and used correctly a few
lines up, for the very same `object_name` dependency, by a widget in the
same form. So this was an **omission**, not a key nobody uses.
Reading 3 was taken in objectui at `befd40cc` and re-taken at this
repo's pinned `.objectui-sha` `87af769e` — the picker reads
`object_name` at the pin too, so the dependency is live in the console
this repo actually ships.
## Why nothing was broken today, and why that is the point
objectui `packages/components/src/renderers/form/form.tsx:3004` passes
`dependentValues: ruleRecord` — the **whole** watched form record, not a
`dependsOn`-scoped slice. That is what masked the under-declaration. A
renderer that ever scoped it — which is exactly what this key asks for —
would drop the object name and degrade the `field` recipient mode to a
plain text input **in silence**: no error, no empty state, just an admin
typing a column name by hand again. The declaration is the only thing
that survives that change, so it is what gets fixed.
## The second half of the fix: the docblock parenthesis, now verified
unblocked
The `recipient_id` docblock said the picker "has no mapping for that
kind and degrades to its text input". That was conditional on
objectui#10049, so it was **checked rather than assumed**:
- objectui#10049 landed as commit `23b99585`, 2026-09-20, `feat(fields):
give RecipientPickerField a picker mode for the field sharing recipient
(objectui#7613)`.
- `git merge-base --is-ancestor 23b99585 87af769e` exits **0** — this
repo's pinned console **includes** it. (Exit 0 is self-proving on a
shallow checkout; the control leg, an older known-ancestor commit, also
exits 0.)
So the parenthesis is false for the console this repo ships, and the
docblock now says what the picker actually does: it offers the shared
object's user-valued columns, using a "holds users" predicate that is a
clause-for-clause copy of this plugin's own `fieldHoldsUsers`.
## Tests
`packages/plugins/plugin-sharing/src/field-recipient.test.ts` gains
three pins in the existing authoring-seams block (which already asserts
declaration facts about this same field):
- `recipient_id.dependsOn` contains `recipient_type`;
- `recipient_id.dependsOn` contains `object_name`;
- control: `criteria_json.dependsOn` still contains `object_name`.
**Reverse verification** — predicted direction: red, and sharply. The
fix was committed first (`5e794538b`), then `dependsOn` was reverted on
disk to `['recipient_type']` through `scripts/ablation-replace.mjs`,
which proved the mutation landed by anchor counts and blob hash
(`3b86f89cc43e` to `158df1894eb5`) before running anything:
```
grep count "dependsOn: ['recipient_type']" -> 1 (mutation on disk)
grep count "dependsOn: ['recipient_type', 'object_name']" -> 0
Tests 1 failed | 2 passed | 57 skipped (60)
FAIL ... names `object_name` — the sibling the `field` mode reads for its candidate columns
```
Exactly one pin failed — the `object_name` one. The `recipient_type` pin
and the `criteria_json` control stayed green, so the new pin is sharp
rather than tautological. Restore verified the way a restore has to be:
blob back to `3b86f89cc43e` == HEAD, and `git diff HEAD` empty.
Other readings, exit codes captured before any pipe:
| run | verdict |
|:--|:--|
| `pnpm --filter @objectstack/plugin-sharing exec vitest run
src/field-recipient.test.ts` | exit 0 — 60 passed |
| `pnpm --filter @objectstack/plugin-sharing build && ... typecheck` |
exit 0 (test layer compiles; debt ledger held) |
| `pnpm --filter '@objectstack/plugin-sharing^...' build` (dependency
closure) | exit 0 |
| `pnpm lint` (repo-wide, `eslint . --no-inline-config`) | exit 0 — no
narrowing claimed |
| `scripts/pm/dispatch-gates.mjs --commands` derived families, all 62
run | 60 exit 0 |
| `pnpm check:i18n` | exit 0 after building its declared 10-package
prerequisite closure — 9 packages in sync |
| `pnpm check:dual-build-cjs-loads`, `pnpm check:type-check-debt` |
**NOT MEASURED** — both exit **3**, PREREQUISITE NOT MET (each needs a
whole-repo `dist`, which is CI's build). Not a red and not a green. |
`dispatch-gates --ran` with those exit codes reconciles: 62 derived, 60
run, 2 NOT-MEASURED, 0 UNRUN.
## Changeset
`patch` on `@objectstack/plugin-sharing`. Measured rather than assumed:
after `pnpm --filter @objectstack/plugin-sharing build`, the changed
declaration is present in the published `files[]` output —
`dist/index.js` carries `dependsOn: ["recipient_type", "object_name"]`,
with `recipient-picker` as the positive control (1 hit). So the publish
surface moves and `skip-changeset` does not apply.
## Acceptance notes
- **Same-shape sweep, negative result.** `widget` is live in this repo
on the `sys_sharing_rule` trio plus `sys_permission_set`'s
`permission-facet-link`. Of the others: `object_name`'s `object-ref`
widget reads no siblings (`ObjectRefField.tsx` contains no
`dependentValues` at all), `criteria_json`'s `filter-condition` widget
reads exactly the `object_name` it already declares, and
`permission-facet-link` reads no siblings either. So `recipient_id` was
the only instance of this defect — nothing else to file.
- No gate or test in this repo pinned `dependsOn` on this object before
this PR; the three added pins are the first, and they sit in the file
that already owns this field's declaration assertions rather than in a
new verification surface.
- Nothing in `packages/spec` is touched, no renderer behaviour is
changed, and no `dependentValues` plumbing is changed — this PR moves a
declaration and the comment that describes it.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01AhQASwqJr2Z7XfGWUdvnbF)_
Co-authored-by: Claude <noreply@anthropic.com>recipient_id declares object_name, the second sibling its picker reads (#19505)1 parent f34dda6 commit 4be0868
3 files changed
Lines changed: 59 additions & 9 deletions
File tree
- .changeset
- packages/plugins/plugin-sharing/src
- objects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
819 | 846 | | |
820 | 847 | | |
821 | 848 | | |
| |||
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
196 | 206 | | |
197 | | - | |
| 207 | + | |
198 | 208 | | |
199 | 209 | | |
200 | 210 | | |
| |||
0 commit comments