MCPcopy Index your code
hub / github.com/simstudioai/sim / getForkParent

Function getForkParent

apps/sim/lib/workspaces/fork/lineage/lineage.ts:31–44  ·  view source on GitHub ↗
(workspaceId: string)

Source from the content-addressed store, hash-verified

29
30/** The parent lineage node for a fork, or null when it has no live parent. */
31export async function getForkParent(workspaceId: string): Promise<ForkLineageNode | null> {
32 const parentId = await getForkParentId(workspaceId)
33 if (!parentId) return null
34 const [row] = await db
35 .select({
36 id: workspace.id,
37 name: workspace.name,
38 organizationId: workspace.organizationId,
39 })
40 .from(workspace)
41 .where(and(eq(workspace.id, parentId), isNull(workspace.archivedAt)))
42 .limit(1)
43 return row ?? null
44}
45
46/**
47 * Resolve the strict fork edge between two workspaces, identifying which is the

Callers 1

route.tsFile · 0.90

Calls 2

getForkParentIdFunction · 0.85
eqFunction · 0.50

Tested by

no test coverage detected