From 093a4e9758e4b277595984e1ecf58f0fb73d0645 Mon Sep 17 00:00:00 2001 From: James Murdza Date: Mon, 9 Dec 2024 13:59:41 -0800 Subject: [PATCH] fix: correctly generate remoteFileId for paths without a leading slash --- backend/server/src/FileManager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/server/src/FileManager.ts b/backend/server/src/FileManager.ts index 86c003d..0a2f558 100644 --- a/backend/server/src/FileManager.ts +++ b/backend/server/src/FileManager.ts @@ -92,7 +92,11 @@ export class FileManager { // Convert local file path to remote path private getRemoteFileId(localId: string): string { - return `projects/${this.sandboxId}${localId}` + return [ + "projects", + this.sandboxId, + localId.startsWith("/") ? localId : localId, + ].join("/") } // Convert remote file path to local file path