Repository navigation
Commit a8b44d4
fix(platform-objects): a team record no longer lists Sessions with "Sign out other devices" (#24881)
Fixes #24765
Clause-②: no (narrowing)
Developer run for the `domain:engine` seat 1 dispatch (claim comment
6289444669), session `session_01NftZtMY2EJSyAjctCSfkis`.
## What changes
`sys_session.active_team_id` is a lookup to `sys_team`. It did not set
`relatedList: false`, so every team record derived a **Sessions**
related list (Setup → Teams → a team → Related). That list carried the
session object's only `list_toolbar` action, "Sign out other devices".
Its confirmation reads "Sign out of every other device where you're
currently logged in?", and it revokes the **caller's** own other
sessions, not the team's.
- `packages/platform-objects/src/identity/sys-session.object.ts`:
`active_team_id` now sets `relatedList: false`, with a one-line comment
saying why. The field, its lookup, its label and its column stay.
better-auth still writes `activeTeamId` there
(`plugin-auth/src/auth-schema-config.ts`).
-
`packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts`
(new): the pins below.
- `.changeset/24765-team-sessions-related-list.md`: `minor` for
`@objectstack/platform-objects` (fix round 1: a narrowing ships `minor`
in the launch window, as Check Changeset's level axis enforces), with
the BREAKING banner and the ADR-0087 disposition `not-required
(no-migration-prescription)` that `check-adr-0087-registration` asks of
a `(narrowing)` arm.
## The read, done before the edit (base `abd5acdaf7`)
- **How a team's related lists are derived.** `sys_team` declares no
record page anywhere in the repo (only `sys_organization` and `sys_user`
have pages), so the console derives the team page's related lists.
`FieldSchema.relatedList` says `false` suppresses the child and absent
shows it. The key is `live` in `packages/spec/liveness/field.json`,
whose evidence is objectui `deriveRelatedLists` skipping the foreign key
when `relatedList` is `false`.
- **Every lookup into `sys_team`** (all `lookup` / `master_detail`
fields in `packages/` and `examples/`): `sys_session.active_team_id`
(fixed here), `sys_team_member.team_id` (the team's Members list, which
is wanted) and `sys_invitation.team_id`. The Invitations list on a team
is named, not changed. Its toolbar action `invite_user` is org-scoped
and not self-scoped. Its `accept_invitation` / `reject_invitation` row
actions are visible only to the invitee (`record.email ==
ctx.user.email`).
- **Who reads a team's Sessions list today:** nobody. No page, test,
doc, `qa/` file or `docs/qa/platform-checklist/` item names it.
`identity-auth.json`'s revoke-other-sessions item is about a user's own
sessions and is unchanged.
- **The user's own Sessions list** is a curated `record:related_list`
tab on `SysUserDetailPage`, keyed on `sys_session.user_id`, and does not
go through `active_team_id`.
## Pins
In `sys-team-derived-related-lists.test.ts`, applying the spec's
derivation rule to every object this package exports:
- the derived related lists of `sys_team` exclude `sys_session` and
still include `sys_team_member.team_id` (a guard against over-applying
the key);
- `sys_session.active_team_id` is still a `lookup` to `sys_team`
labelled "Active Team", with `relatedList: false`;
- `SysUserDetailPage` still lists `sys_session` by `user_id`;
`sys_session.user_id` still derives a list on `sys_user`;
`revoke_my_other_sessions` is still a `list_toolbar` action.
**Ablation**, run through `scripts/ablation-replace.mjs` on the
committed fix. The anchor `relatedList: false,` went 1 → 0 on disk and
the blob went `adf2c552a667` → `55e8613a1c8f`. The file then ran **2
failed | 3 passed**: `exclude sys_session` and the declaration pin went
red. Restored: blob == HEAD `adf2c552a667`, and `git diff HEAD` is
empty. The tests import `src/` directly, so no `dist/` leg applies.
**Pin sweep:** I swept `active_team_id`, "Active Team",
`revoke_my_other_sessions`, "Sign out other devices" and the
confirmation text across `packages/`, `qa/`,
`docs/qa/platform-checklist/` and `content/docs/`. No existing pin
moves.
## Verification
Run at `4f4bb1fab`, which is the branch merged with `origin/main`
`3fbef41b4`, unless a line says otherwise.
- `pnpm --filter @objectstack/platform-objects typecheck`: exit 0. The
first run went red on two type errors in the new test file, which I
fixed. I did not add a ledger entry.
- `pnpm --filter @objectstack/platform-objects test`: exit 0, 80 files,
1204 tests.
- `pnpm --filter @objectstack/core test:repo`: exit 0, 6 files, 82 tests
(pre-merge head).
- Dependent suites, pre-merge head: `plugin-auth` exit 0 (3240 passed,
10 skipped) · `plugin-security` exit 0 (4047 passed, 45 skipped) ·
`runtime` exit 0 (6782 passed, 19 skipped) · `rest` exit 0 (6144 passed,
326 skipped) · `verify` exit 0 (376 passed). The full `cli` unit layer
runs longer than the 10-minute foreground cap, so I left it to CI. Its
tests that read identity objects (`organization-ownership-inventory`,
`unmanaged-tables`, `src/lint`) ran: exit 0, 94 passed.
- Gates: `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` with no paths derived 66 commands, and I ran
all 66. 65 exited 0 on the first pass. `pnpm check:dual-build-cjs-loads`
exited 3 (PREREQUISITE NOT MET: no `dist/`). After `pnpm build` it
exited 0. `--ran` reconciliation: 66 derived, 66 run, 0 NOT-MEASURED, 0
UNRUN, with every line carrying its exit code. After the merge I re-ran
`check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`, `check:i18n`, `check:type-check-debt` and
`check:nul-bytes`: all exit 0.
- `node scripts/check-i18n-bundles.mjs`: exit 0. All bundles are in
sync, so this change regenerates no translation bundle.
## Acceptance notes
- **Not asked, not built:** a team-scoped session action, and any change
to `revoke_session` or to the header action.
- This narrowing owes a `CONTRACT_REVIEW_TIER` review of record before
the queue, run by the seat.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01NftZtMY2EJSyAjctCSfkis)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent fcb40ad commit a8b44d4
3 files changed
Lines changed: 111 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
| |||
| 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 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
0 commit comments