You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 872978b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-sharing)!: a failed team-graph manager read refuses instead of answering no manager
TeamGraphService.managerOf reads sys_user through readMembershipToCompletion
as a lookup: a failed read throws and nothing is cached for it; a missing
object still answers null. holderReadRefusal gains a lookup arm, used by
BusinessUnitGraphService.headOf and the standalone managerOf too. The spec
JSDoc of ITeamGraphService.managerOf and IBusinessUnitGraphService.headOf
says so instead of best-effort.
Claude-Session: https://claude.ai/code/session_01JQwxbXvyuTnWc7sv5i5DBw
Co-authored-by: Claude <noreply@anthropic.com>
fix(plugin-sharing)!: a failed team-graph manager read refuses instead of answering no manager
7
+
8
+
Clause-②: no (narrowing)
9
+
Metadata-protocol: none
10
+
11
+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no metadata changes: the lookup reads the row it already read, and refuses a read that already failed. The spec change is interface documentation only. No author has anything to rewrite. -->
12
+
13
+
**BREAKING** only where the read fails: `TeamGraphService.managerOf` used to answer `null` then, and now refuses.
14
+
15
+
The holder reads of `TeamGraphService`, and the head and standalone manager lookups of `BusinessUnitGraphService`, already refuse on a failed read. This was the last lookup of that family that did not.
16
+
17
+
-**`TeamGraphService.managerOf(userId, organizationId)`.** A failed `sys_user` read now throws. Before, it answered `null` (no manager) and kept that answer for the rest of the pass, so the manager stayed missing after the read recovered. Nothing is cached after a failed read now: the next call reads again.
18
+
-**Who sees it.** The `manager` arm of the exported `expandPrincipal`, and `BusinessUnitGraphService.managerOf` when it is built with a `teamGraph`, pass the refusal through instead of answering no manager.
19
+
-**A missing object is still nobody.** A stack that never registers, or never creates, `sys_user` keeps answering `null`. That is judged by `isObjectAbsentError`; any other error stays loud.
20
+
-**The organization screen is unchanged.** When `sys_member` cannot be read, the manager is still kept, as before.
21
+
-**The refusal names a lookup.** A failed head or manager lookup now says it is a lookup of one person, not a holder set or an expansion.
22
+
-**The contract says so.** The documentation of `ITeamGraphService.managerOf` and `IBusinessUnitGraphService.headOf` in `@objectstack/spec` now reads "refuses (throws) on a failed read; `null` when none" instead of "best-effort". No key or type changes.
23
+
-**No caller on this release changes behaviour.** No sharing rule, approval or ownership queue on this release calls `managerOf` or `expandPrincipal`. A caller of the exported class or function sees the refusal instead of `null`.
24
+
25
+
**The remedy.** None is needed. A refusal means the user table could not be read: fix that read, and the next lookup succeeds.
0 commit comments