Repository navigation
refactor(interface-dms)!: remove TenantMemberModel.listAll() - #1228
Merged
Merged
Conversation
… listAll page_verify picks a sole holder per role with one projected row per role, and the tests read only the member fields they compare.
BREAKING CHANGE: TenantMemberModel.listAll() is gone. Read members through count(), listOwners() or a projected, bounded query on the table.
Upd4ting
marked this pull request as ready for review
November 20, 2026 22:24
Upd4ting
enabled auto-merge
November 20, 2026 22:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wec9b4589-22.
⚠ sensitive: removes TenantMemberModel.listAll() from the interface-dms contract
Summary
TenantMemberModel.listAll()read every member of a workspace with no bound. This PR removes it from@antelopejs/interface-dms, so a new call fails the typecheck, and moves every dms caller to a bounded read first.page_verify(packages/dms/src/mcp/page-verify/accounts.ts) loaded every member of the owner's workspace to pick, per role, a member holding that role alone.pickMembernow asks the database for that member directly: one filtered row per role (roleIdsequal to[roleId], not a workspace owner, not a platform owner), projected touserId,roleIdsandisTenantOwner. The rule it applies is unchanged.role-holder-reads.test.ts,notification-recipients.test.ts) now read only the fields they compare, withtable.pluck(...).listAlloverride.listAll()row.flowchart TD A[loadWorkspace] --> B[roles of the owner's workspace + platform owners] B --> C{for each role} C --> D["pickMember: first row where roleIds = [role], not tenant owner, not platform owner<br/>(was: listAll() of every member, then find in JS)"] D --> E[memberByRole]Breaking change
TenantMemberModel.listAll()no longer exists. Migration: read members throughcount(),listOwners(), or a filtered, projected query onmodel.table, such asmodel.table.filter(...).pluck("userId", "roleIds").run().This must ship in a minor release (0.15.0), not a 0.14.x patch: two module repos still call it and pin
<0.15.0, so they keep resolving 0.14.x until they upgrade.Module repos (code search of the AntelopeJS org, then each file read):
src/access/contacts.ts:57andsrc/access/rows.ts:176, and pins>=0.14.1 <0.15.0.>=0.14.0 <0.15.0.Both are listed under Follow-ups.
Related issue
Wec9b4589-22 (no Notion page). Follows ANT-3518 (AntelopeJS/dms-saas#320).
Verification
A probe file in
packages/dms/srccalling the removed method:pnpm --dir packages/dms typecheckbefore the removal (exit 0):After (exit 1):
The
pickMemberunit test (page-verify.test.ts) now seeds members into a workspace: a member with two roles, a workspace owner, a platform owner, sole holders, a sole holder stored withoutisTenantOwner, and a sole holder in another workspace. Three mutants of the built query fail it:AssertionError: expected { …(4) } to equal undefinedAssertionError: expected 'owner' to equal 'viewer-only'isTenantOwnerto equalfalse, which skips a row stored without the field:AssertionError: expected undefined to equal 'unflagged'Runs (in-memory MongoDB, one file each):
dist/test/unit/mcp/page-verify.test.js: 10 passingdist/test/unit/pages/settings/role-holder-reads.test.js: 6 passingdist/test/integration/notification-recipients.test.js: 4 passingpnpm run typecheck: exit 0.oxlinton the changed files: no findings.Follow-ups
src/access/contacts.ts:57andsrc/access/rows.ts:176read every member of a workspace withTenantMemberModel.listAll(), done means both read through a bounded or projected query and cloud typechecks against interface-dms 0.15.0, which dropslistAll().packages/dms-saas/test/seat-usage-queries.test.ts:37andpackages/dms-saas/test/platform-reads-in-query.test.ts:427still callTenantMemberModel.listAll()(ANT-3518's Done means covers product code only), done means both tests read members through a projected query and the dms-saas test typecheck passes against an interface-dms withoutlistAll().Checklist