Restore generic Studio object navigation and discovery
This commit is contained in:
@@ -381,6 +381,27 @@ export function compileExecutionPlan(input: WorkspaceRevision): ExecutionPlan {
|
||||
query.id,
|
||||
"Local and replica queries must use the same root contract",
|
||||
);
|
||||
if (localRoot.kind === "workspace-interface") {
|
||||
const sourceWindows = source.query.checked.selection
|
||||
.flatMap((root) => root.selection)
|
||||
.filter((s) => s.name === "objects");
|
||||
for (const selection of query.query.checked.selection
|
||||
.flatMap((root) => root.selection)
|
||||
.filter((s) => s.name === "objects")) {
|
||||
if (
|
||||
!sourceWindows.some(
|
||||
(window) =>
|
||||
canonicalJson({ arguments: window.arguments, conditions: window.conditions }) ===
|
||||
canonicalJson({ arguments: selection.arguments, conditions: selection.conditions }),
|
||||
)
|
||||
)
|
||||
throw new ExecutionPlanError(
|
||||
"REPLICA_WINDOW_MISMATCH",
|
||||
query.id,
|
||||
"Local objects must observe the identical confirmed source window; use availableObjects for a local candidate view",
|
||||
);
|
||||
}
|
||||
}
|
||||
const traversals = (linked: LinkedQuery) => {
|
||||
const paths = new Map<string, { complete: boolean; requiresComplete: boolean; windows: Set<string> }>();
|
||||
const entry = (key: string) => {
|
||||
|
||||
+4
-1
@@ -27,7 +27,7 @@ export function queryRootSchema(root: QueryRoot, interfaces: readonly InterfaceR
|
||||
{
|
||||
kind: "relationship",
|
||||
id: workspaceObjectsMemberId,
|
||||
displayName: local ? "availableObjects" : "objects",
|
||||
displayName: "objects",
|
||||
target: { kind: "interface", interfaceRevisionId: root.interface },
|
||||
cardinality: "many-unique",
|
||||
ordered: false,
|
||||
@@ -36,5 +36,8 @@ export function queryRootSchema(root: QueryRoot, interfaces: readonly InterfaceR
|
||||
},
|
||||
],
|
||||
};
|
||||
// Local objects observes the confirmed server window. availableObjects is the
|
||||
// separate opt-in view that also includes pending local candidates.
|
||||
if (local) synthetic.members.push({ ...synthetic.members[0]!, displayName: "availableObjects" });
|
||||
return { interface: synthetic.revisionId, interfaces: [...interfaces, synthetic] };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user