mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #32776 from overleaf/bg-record-file-source-in-filenames
record upload type in temporary filenames GitOrigin-RevId: 83232be85ad58e03b1ce9da4bb7de54f7a7cfdb0
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user