From a92237c0fd48615a18e1d80420569e07e40e49d1 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Sun, 16 Jun 2024 00:21:45 +0300 Subject: [PATCH 1/3] [bug] Use outputFormat in id instead of outputType; Fix bug 68653 --- DocService/sources/converterservice.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DocService/sources/converterservice.js b/DocService/sources/converterservice.js index 5dad20018..2cf7781fc 100644 --- a/DocService/sources/converterservice.js +++ b/DocService/sources/converterservice.js @@ -261,8 +261,7 @@ function convertRequest(req, res, isJson) { } let filetype = params.filetype || params.fileType || ''; let outputtype = params.outputtype || params.outputType || ''; - let docId = 'conv_' + params.key + '_' + outputtype; - ctx.setDocId(docId); + ctx.setDocId(params.key); if (params.key && !constants.DOC_ID_REGEX.test(params.key)) { ctx.logger.warn('convertRequest unexpected key = %s', params.key); @@ -291,6 +290,8 @@ function convertRequest(req, res, isJson) { outputFormat = constants.AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM_PDF; } } + //todo use hash of params as id + let docId = 'conv_' + params.key + '_' + outputFormat; var cmd = new commonDefines.InputCommand(); cmd.setCommand('conv'); cmd.setUrl(params.url); From 373671902fa35b9259f4da652da5c283e40b59a5 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Sun, 16 Jun 2024 01:45:20 +0300 Subject: [PATCH 2/3] [bug] Fix crash; For bug 68645 --- DocService/sources/canvasservice.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index 034b4e664..2b9c44e35 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -1789,7 +1789,7 @@ exports.saveFromChanges = function(ctx, docId, statusInfo, optFormat, opt_userId async function processWopiSaveAs(ctx, cmd) { const info = await docsCoServer.getCallback(ctx, cmd.getDocId(), cmd.getUserIndex()); // info.wopiParams is null if it is not wopi - if (info.wopiParams) { + if (info?.wopiParams) { const suggestedTargetType = `.${formatChecker.getStringFromFormat(cmd.getOutputFormat())}`; const storageFilePath = `${cmd.getSaveKey()}/${cmd.getOutputPath()}`; const stream = await storage.createReadStream(ctx, storageFilePath); From 87f2847aba9651495f22e558b2d79cbed0c2ee4a Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Sun, 16 Jun 2024 22:20:45 +0300 Subject: [PATCH 3/3] [bug] Add maxRetries option to fix unexpected ENOTEMPTY during rm --- Common/sources/storage-fs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/sources/storage-fs.js b/Common/sources/storage-fs.js index 3257dc2f2..5c0a299f6 100644 --- a/Common/sources/storage-fs.js +++ b/Common/sources/storage-fs.js @@ -117,7 +117,7 @@ async function deleteObject(storageCfg, strPath) { async function deletePath(storageCfg, strPath) { const fsPath = getFilePath(storageCfg, strPath); - return rm(fsPath, {force: true, recursive: true}); + return rm(fsPath, {force: true, recursive: true, maxRetries: 3}); } async function getSignedUrl(ctx, storageCfg, baseUrl, strPath, urlType, optFilename, opt_creationDate) {