Skip to content

fix(admin): collapse duplicate global system roles on list and prevent seed re-insertion - #405

Merged
telivity-otaip merged 4 commits into
mainfrom
cursor/haip-dedupe-system-roles-85a3
Nov 13, 2026
Merged

telivity-otaip merged 4 commits into
mainfrom
cursor/haip-dedupe-system-roles-85a3

Conversation

@telivity-otaip

@telivity-otaip telivity-otaip commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Deduplicate global system roles (isSystem / propertyId == null) by key in RolesService.list / dedupeSystemRoles while keeping every property-scoped custom role distinct by id.
  • Compare candidates using each row’s own property-scoped role_permissions (richest set wins; canonical ee000001-* on a tie). Return only the selected ID’s permissions — never a union across discarded duplicates.
  • Seed still reuses any existing property_id IS NULL system role row by key before inserting (no role deletion/migration).
  • Companion Remy fix in feat(channel): DerbySoft Property Connector adapter (#92–#94) #154. Synced published test counts to 2677 / 314 after the new regression cases.

Verification

  • vitest run src/modules/admin/roles.service.spec.ts (9/9) and admin module suite (19/19).
  • CI fix: refreshed README.md + docs/test-stats.json for the stale published-count gate.
Open in Web Open in Cursor 

cursoragent and others added 2 commits November 11, 2026 11:29
…t seed re-insertion

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip telivity-otaip self-assigned this Nov 12, 2026
cursoragent and others added 2 commits November 13, 2026 05:12
Select the representative global system role using each candidate’s own
property-scoped role_permissions, prefer the richest set (canonical
ee000001-* on ties), and return only that ID’s permissions. Custom
property-scoped roles stay distinct. Regression tests cover overlapping
unequal sets and list hydration without cross-ID bleed.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
CI rejected stale README/docs/test-stats.json after the roles.service
regression cases landed (actual Vitest totals 2677 / 314).

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip
telivity-otaip removed the request for review from agustinjch November 13, 2026 05:30
@telivity-otaip
telivity-otaip merged commit a07390c into main Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants