( workspaceAId: string, workspaceBId: string )
| 49 | * null when the two workspaces are not a direct parent/child pair. |
| 50 | */ |
| 51 | export 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 |
no test coverage detected