From 4a1909b03c4df8d18ff72f6ca98e2dcf06878988 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 22 Aug 2024 18:12:43 +0300 Subject: [PATCH] [se] Fix error while downloadas; For bug 62643 --- DocService/sources/canvasservice.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index 8bd1dd72..e871c631 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -1805,7 +1805,7 @@ async function processWopiSaveAs(ctx, cmd) { const { wopiSrc, access_token } = info.wopiParams.userAuth; res = await wopiClient.putRelativeFile(ctx, wopiSrc, access_token, null, stream.readStream, stream.contentLength, suggestedExt, suggestedTarget, false); } - return res; + return {res: res, wopiParams: info?.wopiParams}; } exports.receiveTask = function(data, ack) { return co(function* () { @@ -1827,10 +1827,10 @@ exports.receiveTask = function(data, ack) { yield getOutputData(ctx, cmd, outputData, cmd.getDocId(), null, additionalOutput); } else if ('save' === command || 'savefromorigin' === command) { let status = yield getOutputData(ctx, cmd, outputData, cmd.getDocId() + cmd.getSaveKey(), null, additionalOutput); - if (commonDefines.FileStatus.Ok === status && (undefined !== cmd.getSaveAsPath() || cmd.getIsSaveAs())) { + if (commonDefines.FileStatus.Ok === status && (cmd.getSaveAsPath() || cmd.getIsSaveAs())) { //todo in case of wopi no need to send url. send it to avoid stubs in sdk let saveAsRes = yield processWopiSaveAs(ctx, cmd); - if (!saveAsRes) { + if (!saveAsRes.res && saveAsRes.wopiParams) { outputData.setStatus('err'); outputData.setData(constants.UNKNOWN); }