From 24c82fa7b627ea62f636926c8a6b0b78fa245e2d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 20 Jun 2025 22:13:36 +0300 Subject: [PATCH] fix(import/zip): regression in normal import --- apps/server/src/services/import/zip.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/server/src/services/import/zip.ts b/apps/server/src/services/import/zip.ts index 93eb1b306..e7da680bb 100644 --- a/apps/server/src/services/import/zip.ts +++ b/apps/server/src/services/import/zip.ts @@ -262,13 +262,13 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo } function getEntityIdFromRelativeUrl(url: string, filePath: string) { - let absUrl; + let absUrl: string; if (!url.startsWith("/")) { while (url.startsWith("./")) { url = url.substr(2); } - let absUrl = path.dirname(filePath); + absUrl = path.dirname(filePath); while (url.startsWith("../")) { absUrl = path.dirname(absUrl); @@ -285,6 +285,8 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo absUrl = topLevelPath + url; } + console.log(url, "-->", absUrl); + const { noteMeta, attachmentMeta } = getMeta(absUrl); if (attachmentMeta && attachmentMeta.attachmentId && noteMeta.noteId) {