From b26ffb81fd2521070e58266c5be0764f29896edc Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Tue, 5 Mar 2024 09:18:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Malformed=20shared=20item=20URL?= =?UTF-8?q?=20(#410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tdrive/backend/node/package.json | 2 +- .../node/src/core/platform/services/email-pusher/index.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tdrive/backend/node/package.json b/tdrive/backend/node/package.json index dc96fa93..b55c188f 100644 --- a/tdrive/backend/node/package.json +++ b/tdrive/backend/node/package.json @@ -28,7 +28,7 @@ "test:unit:watch": "npm run test:unit -- --watchAll --verbose false | pino-pretty", "test:merge:json": "npx istanbul report --dir coverage/merged --include 'coverage/**/coverage-final.json' json-summary", "test:merge:text": "npx istanbul report --dir coverage/merged --include 'coverage/**/coverage-final.json' text > coverage/merged/coverage-report.txt", - "test:all": "jest test --forceExit --coverage --detectOpenHandles --testTimeout=30000 --verbose false --runInBand", + "test:all": "jest test --forceExit --coverage --detectOpenHandles --testTimeout=300000 --verbose false --runInBand", "kill": "kill $(lsof -t -i:3000) | exit 0" }, "jest": { diff --git a/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts b/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts index c444a56f..2cffec83 100644 --- a/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts +++ b/tdrive/backend/node/src/core/platform/services/email-pusher/index.ts @@ -84,8 +84,9 @@ export default class EmailPusherClass const templatePath = path.join(__dirname, "templates", language, `${template}.eta`); const subjectPath = path.join(__dirname, "templates", language, `${template}.subject.eta`); const encodedCompanyId = translator.fromUUID(data.notifications[0].item.company_id); - const encodedFileId = translator.fromUUID(data.notifications[0].item.id); - const encodedUrl = `${this.platformUrl}/client/${encodedCompanyId}/v/shared_with_me/preview/${encodedFileId}`; + const encodedItemId = translator.fromUUID(data.notifications[0].item.id); + const previewType = data.notifications[0].item.is_directory ? "d" : "preview"; + const encodedUrl = `${this.platformUrl}/client/${encodedCompanyId}/v/shared_with_me/${previewType}/${encodedItemId}`; if (!existsSync(templatePath)) { throw Error(`template not found: ${templatePath}`);