@@ -133,7 +133,7 @@ import { isWorkspaceTrustedForSharedExecution } from "@/node/services/utils/work
133133import { mergeMultiProjectSecrets } from "@/node/services/utils/multiProjectSecrets";
134134import { getLegacyPlanFilePath, sharesPlanDirectory } from "@/common/utils/planStorage";
135135import {
136- getImportableLegacyPlanPath ,
136+ findImportableLegacyPlanPath ,
137137 importLegacyRemotePlan,
138138 markRemotePlanMigratedForDeletion,
139139 resolvePlanFileLocation,
@@ -5605,8 +5605,8 @@ export class WorkspaceService
56055605 /**
56065606 * The shared pre-#5174 plan path the user can import into this SSH workspace (Option B): only
56075607 * for a row from before #5174 whose only legacy plan is that file. Null otherwise, and for
5608- * non-SSH workspaces. Resolving the location runs the row's automatic migration first, so an
5609- * own plans/<id>.md plan is migrated rather than offered.
5608+ * non-SSH workspaces. This runs the row's automatic migration first, so an own plans/<id>.md
5609+ * plan is migrated rather than offered.
56105610 */
56115611 public async getImportableLegacyPlan(workspaceId: string): Promise<Result<string | null>> {
56125612 const metadata = await this.getInfo(workspaceId);
@@ -5615,8 +5615,7 @@ export class WorkspaceService
56155615 try {
56165616 const runtime = createRuntimeForWorkspace(metadata);
56175617 const owner = { ...metadata, id: workspaceId };
5618- await this.resolvePlanLocation(owner, runtime);
5619- const legacyPath = getImportableLegacyPlanPath(this.config, runtime, owner);
5618+ const legacyPath = await findImportableLegacyPlanPath(this.config, runtime, owner);
56205619 return Ok(legacyPath === undefined ? null : await runtime.resolvePath(legacyPath));
56215620 } catch (error) {
56225621 return Err(`Failed to check for a plan from an older Xum: ${getErrorMessage(error)}`);
@@ -9964,7 +9963,7 @@ export class WorkspaceService
99649963 // A row whose only legacy plan is the shared basename file stays unmigrated until the
99659964 // user imports it (Option B). That file is named after the workspace, so after a rename
99669965 // the offer would look at another path and the plan would be orphaned: refuse instead.
9967- const importable = getImportableLegacyPlanPath (this.config, runtimeForPlanFile, {
9966+ const importable = await findImportableLegacyPlanPath (this.config, runtimeForPlanFile, {
99689967 ...oldMetadata,
99699968 id: workspaceId,
99709969 });
0 commit comments