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

Function resolveForkEdge

apps/sim/lib/workspaces/fork/lineage/lineage.ts:51–63  ·  view source on GitHub ↗
(
  workspaceAId: string,
  workspaceBId: string
)

Source from the content-addressed store, hash-verified

49 * null when the two workspaces are not a direct parent/child pair.
50 */
51export async function resolveForkEdge(
52 workspaceAId: string,
53 workspaceBId: string
54): Promise<ForkEdge | null> {
55 if (workspaceAId === workspaceBId) return null
56 if ((await getForkParentId(workspaceAId)) === workspaceBId) {
57 return { childWorkspaceId: workspaceAId, parentWorkspaceId: workspaceBId }
58 }
59 if ((await getForkParentId(workspaceBId)) === workspaceAId) {
60 return { childWorkspaceId: workspaceBId, parentWorkspaceId: workspaceAId }
61 }
62 return null
63}
64
65/**
66 * How long a fork transaction waits for a lock before aborting. Bounds the wait on the

Callers 2

assertCanPromoteFunction · 0.90
rollbackForkFunction · 0.90

Calls 1

getForkParentIdFunction · 0.85

Tested by

no test coverage detected