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
fix(resource): reconcile #project/#owner relations on update
resource.Update was DB-only and persisted just title/metadata, so moving a
resource to a new project or reassigning its owner was a silent no-op: the
change was dropped from the row and the old #project/#owner SpiceDB tuples
stayed put while the new ones were never written.
Update now:
- persists project_id, principal_id, principal_type, and a recomputed URN
(name and namespace remain immutable on update);
- when the project changes, deletes the old app/<ns>:<id>#project tuple and
writes the new one;
- when the owner changes, deletes the old #owner tuple and writes the new one.
PAT owners are resolved to the underlying user, mirroring Create.
Adds an e2e regression test: create a resource in project A, move it to
project B, assert the #project relation now points at B (old tuple gone).
Verified it fails without the reconcile (relation stays on A) and passes
with it.
Refs #1661
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments