Skip to content

Commit 5d59c0a

Browse files
hotlongCopilot
andcommitted
fix(objectql): use valid scope value for project overlay rows
protocol.saveMetaItem was writing scope='project' for per-project customizations, but the sys_metadata.scope enum is ['system', 'platform', 'user']. Every Studio overlay write ("Duplicate view", edit field, etc.) on a tenant environment hit Field.select validation and returned 500 overlay_persistence_failed. Project isolation is already provided by the project_id column (part of the overlay-active unique index), so the scope label is informational. Always write 'platform' — the value the schema already defaults to. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4f6bae0 commit 5d59c0a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/objectql/src/protocol.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,10 @@ export class ObjectStackProtocolImplementation implements ObjectStackProtocol {
17421742
type: request.type,
17431743
// `scope` is informational; `project_id` is the authoritative
17441744
// isolation key (see sys-metadata schema unique index).
1745-
scope: this.projectId !== undefined ? 'project' : 'platform',
1745+
// We always write 'platform' here — per-project overlays
1746+
// are distinguished by `project_id`, not by a separate
1747+
// scope value (the enum is ['system','platform','user']).
1748+
scope: 'platform',
17461749
metadata: JSON.stringify(request.item),
17471750
state: 'active',
17481751
version: 1,

0 commit comments

Comments
 (0)