mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 01:27:35 +00:00
feat(wsl-mover): pause a moving project's terminals through Sleep and prove they exited (D1b-5d) (#28820)
* feat(wsl-mover): pause a moving project's terminals through Sleep and prove they exited (D1b-5d) * fix(wsl-mover): gate again under the fence, swap journal phases atomically, keep sessions frozen through commit (D1b-5d) * test(wsl-mover): the fence e2e walks the journal one phase at a time, as a move writes it (D1b-5d)
This commit is contained in:
@@ -266,6 +266,14 @@ function entryWorkspaceResolver(
|
||||
export function withoutWorkspaces(
|
||||
base: WorkspaceSessionState,
|
||||
workspaceIds: ReadonlySet<string>
|
||||
): WorkspaceSessionState {
|
||||
return filterWorkspaceRows(base, (workspaceId) => !workspaceIds.has(workspaceId))
|
||||
}
|
||||
|
||||
/** The scoped rows of the workspaces kept, by the same routing; global fields stay as they are. */
|
||||
export function filterWorkspaceRows(
|
||||
base: WorkspaceSessionState,
|
||||
keepsWorkspace: (workspaceId: string) => boolean
|
||||
): WorkspaceSessionState {
|
||||
const worktreeIdByTabId = buildWorktreeIdByTabId(base)
|
||||
const worktreeIdByFileId = buildWorktreeIdByFileId(base)
|
||||
@@ -273,7 +281,7 @@ export function withoutWorkspaces(
|
||||
for (const field of SESSION_FIELDS) {
|
||||
const workspaceOf = entryWorkspaceResolver(field, worktreeIdByTabId, worktreeIdByFileId)
|
||||
const keeps = (key: string, entry: unknown): boolean =>
|
||||
!workspaceIds.has(normalizeWorkspaceSessionKeyToWorkspaceId(workspaceOf?.(key, entry) ?? ''))
|
||||
keepsWorkspace(normalizeWorkspaceSessionKeyToWorkspaceId(workspaceOf?.(key, entry) ?? ''))
|
||||
const value: unknown = base[field]
|
||||
if (!workspaceOf || !value) {
|
||||
continue
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/** Main asks the renderer to Sleep workspaces and waits until their slept state is durable. */
|
||||
export type WorktreeSleepRequest = {
|
||||
requestId: string
|
||||
worktreeIds: string[]
|
||||
}
|
||||
|
||||
export type WorktreeSleepResponse = {
|
||||
requestId: string
|
||||
/** Workspaces whose Sleep failed; they stay awake and retryable. */
|
||||
failedWorktreeIds?: string[]
|
||||
error?: string
|
||||
}
|
||||
Reference in New Issue
Block a user