diff --git a/services/web/app/src/Features/History/RestoreManager.mjs b/services/web/app/src/Features/History/RestoreManager.mjs index 6bbf1eba52..b3b6166777 100644 --- a/services/web/app/src/Features/History/RestoreManager.mjs +++ b/services/web/app/src/Features/History/RestoreManager.mjs @@ -437,13 +437,16 @@ const RestoreManager = { const url = `${ Settings.apis.project_history.url }/project/${projectId}/version/${version}/${encodeURIComponent(pathname)}` - return await FileWriter.promises.writeUrlToDisk(projectId, url) + return await FileWriter.promises.writeUrlToDisk( + projectId + '_restore-manager-version', + url + ) }, async _writeSnapshotFileToDisk(historyId, file) { if (file.isEditable()) { return await FileWriter.promises.writeContentToDisk( - historyId, + historyId + '_restore-manager-editable', file.getContent() ) } else { @@ -452,7 +455,10 @@ const RestoreManager = { historyId, hash ) - return await FileWriter.promises.writeStreamToDisk(historyId, stream) + return await FileWriter.promises.writeStreamToDisk( + historyId + '_restore-manager-blob', + stream + ) } }, } diff --git a/services/web/app/src/Features/LinkedFiles/LinkedFilesHandler.mjs b/services/web/app/src/Features/LinkedFiles/LinkedFilesHandler.mjs index aee33a6eb0..be0836edab 100644 --- a/services/web/app/src/Features/LinkedFiles/LinkedFilesHandler.mjs +++ b/services/web/app/src/Features/LinkedFiles/LinkedFilesHandler.mjs @@ -60,7 +60,7 @@ const LinkedFilesHandler = { userId ) { const fsPath = await FileWriter.promises.writeStreamToDisk( - projectId, + projectId + '_linked-files-handler-stream', readStream ) @@ -88,7 +88,7 @@ const LinkedFilesHandler = { userId ) { const fsPath = await FileWriter.promises.writeContentToDisk( - projectId, + projectId + '_linked-files-handler-content', content ) diff --git a/services/web/app/src/Features/Templates/TemplatesManager.mjs b/services/web/app/src/Features/Templates/TemplatesManager.mjs index 0781597cc5..8ec52d4b1d 100644 --- a/services/web/app/src/Features/Templates/TemplatesManager.mjs +++ b/services/web/app/src/Features/Templates/TemplatesManager.mjs @@ -47,7 +47,7 @@ const TemplatesManager = { }) const projectName = ProjectDetailsHandler.fixProjectName(templateName) - const dumpPath = `${settings.path.dumpFolder}/${crypto.randomUUID()}` + const dumpPath = `${settings.path.dumpFolder}/${crypto.randomUUID()}_templates-manager` const writeStream = fs.createWriteStream(dumpPath) try { const attributes = { diff --git a/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.mjs b/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.mjs index cd9514036e..c0c6a3ca48 100644 --- a/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.mjs +++ b/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.mjs @@ -27,7 +27,7 @@ async function mergeUpdate(userId, projectId, path, updateRequest, source) { async function writeUpdateToDisk(projectId, updateStream) { const fsPath = `${ Settings.path.dumpFolder - }/${projectId}_${crypto.randomUUID()}` + }/${projectId}_${crypto.randomUUID()}_update-merger` const writeStream = fs.createWriteStream(fsPath) try { await pipeline(updateStream, writeStream) diff --git a/services/web/app/src/Features/Uploads/DocumentConversionManager.mjs b/services/web/app/src/Features/Uploads/DocumentConversionManager.mjs index 97021f4429..dddaaa49df 100644 --- a/services/web/app/src/Features/Uploads/DocumentConversionManager.mjs +++ b/services/web/app/src/Features/Uploads/DocumentConversionManager.mjs @@ -26,7 +26,7 @@ async function convertDocxToLaTeXZipArchive(path, userId) { 'sending docx to CLSI for conversion' ) - const outputFileName = crypto.randomUUID() + '.zip' + const outputFileName = crypto.randomUUID() + '_document-conversion' + '.zip' const outputPath = Path.join(Settings.path.dumpFolder, outputFileName) let outputStream const abortController = new AbortController() diff --git a/services/web/test/unit/src/Templates/TemplatesManager.test.mjs b/services/web/test/unit/src/Templates/TemplatesManager.test.mjs index 92bf929253..48ee3d0da4 100644 --- a/services/web/test/unit/src/Templates/TemplatesManager.test.mjs +++ b/services/web/test/unit/src/Templates/TemplatesManager.test.mjs @@ -18,7 +18,7 @@ describe('TemplatesManager', function () { ctx.user_id = 'user-id' ctx.dumpFolder = 'dump/path' ctx.uuid = '1234' - ctx.dumpPath = `${ctx.dumpFolder}/${ctx.uuid}` + ctx.dumpPath = `${ctx.dumpFolder}/${ctx.uuid}_templates-manager` ctx.callback = sinon.stub() ctx.pipeline = sinon.stub().callsFake(async (stream, res) => { if (res.callback) res.callback() diff --git a/services/web/test/unit/src/ThirdPartyDataStore/UpdateMerger.test.mjs b/services/web/test/unit/src/ThirdPartyDataStore/UpdateMerger.test.mjs index 58bc5f974d..85f7b0de2b 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/UpdateMerger.test.mjs +++ b/services/web/test/unit/src/ThirdPartyDataStore/UpdateMerger.test.mjs @@ -26,7 +26,7 @@ describe('UpdateMerger :', function () { ctx.existingDocs = [{ path: '/main.tex' }, { path: '/folder/other.tex' }] ctx.existingFiles = [{ path: '/figure.pdf' }, { path: '/folder/fig1.pdf' }] - ctx.fsPath = `${ctx.dumpPath}/${ctx.projectId}_${ctx.randomUUID}` + ctx.fsPath = `${ctx.dumpPath}/${ctx.projectId}_${ctx.randomUUID}_update-merger` ctx.fileContents = `\\documentclass{article} \\usepackage[utf8]{inputenc} diff --git a/services/web/test/unit/src/Uploads/DocumentConversionManager.test.mjs b/services/web/test/unit/src/Uploads/DocumentConversionManager.test.mjs index 8c607f82d7..8de7ca8806 100644 --- a/services/web/test/unit/src/Uploads/DocumentConversionManager.test.mjs +++ b/services/web/test/unit/src/Uploads/DocumentConversionManager.test.mjs @@ -131,7 +131,7 @@ describe('DocumentConversionManager', function () { it('should return a path to the output file', function (ctx) { expect(ctx.result).to.match( - /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.zip/ + /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}_document-conversion\.zip/ ) }) }) @@ -157,7 +157,7 @@ describe('DocumentConversionManager', function () { sinon.assert.calledWith( ctx.fsPromises.unlink, sinon.match( - /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.zip/ + /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}_document-conversion\.zip/ ) ) }) @@ -210,7 +210,7 @@ describe('DocumentConversionManager', function () { sinon.assert.calledWith( ctx.fsPromises.unlink, sinon.match( - /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.zip/ + /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}_document-conversion\.zip/ ) ) }) @@ -248,7 +248,7 @@ describe('DocumentConversionManager', function () { sinon.assert.calledWith( ctx.fsPromises.unlink, sinon.match( - /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.zip/ + /\/path\/to\/dump\/folder\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}_document-conversion\.zip/ ) ) })