mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #28945 from overleaf/mj-tear-down-server-side-referencing
[web] Tear down server side referencing GitOrigin-RevId: 37feac39cc7bf219a2cbc463191163534434f267
This commit is contained in:
committed by
Copybot
parent
45ad16445f
commit
43a80ef8a5
@@ -19,12 +19,10 @@ import LinkedFilesErrors from './LinkedFilesErrors.mjs'
|
||||
import {
|
||||
OutputFileFetchFailedError,
|
||||
FileTooLargeError,
|
||||
OError,
|
||||
} from '../Errors/Errors.js'
|
||||
import Modules from '../../infrastructure/Modules.js'
|
||||
import { plainTextResponse } from '../../infrastructure/Response.js'
|
||||
import { z, zz, validateReq } from '../../infrastructure/Validation.js'
|
||||
import ReferencesHandler from '../References/ReferencesHandler.mjs'
|
||||
import EditorRealTimeController from '../Editor/EditorRealTimeController.js'
|
||||
import { expressify } from '@overleaf/promise-utils'
|
||||
import ProjectOutputFileAgent from './ProjectOutputFileAgent.mjs'
|
||||
@@ -142,26 +140,16 @@ async function refreshLinkedFile(req, res, next) {
|
||||
}
|
||||
|
||||
if (req.body.shouldReindexReferences) {
|
||||
let data
|
||||
try {
|
||||
data = await ReferencesHandler.promises.indexAll(projectId)
|
||||
} catch (error) {
|
||||
OError.tag(error, 'failed to index references', {
|
||||
projectId,
|
||||
})
|
||||
return next(error)
|
||||
}
|
||||
// Signal to clients that they should re-index references
|
||||
EditorRealTimeController.emitToRoom(
|
||||
projectId,
|
||||
'references:keys:updated',
|
||||
data.keys,
|
||||
[],
|
||||
true,
|
||||
clientId
|
||||
)
|
||||
res.json({ new_file_id: newFileId })
|
||||
} else {
|
||||
res.json({ new_file_id: newFileId })
|
||||
}
|
||||
res.json({ new_file_id: newFileId })
|
||||
}
|
||||
|
||||
export default LinkedFilesController = {
|
||||
|
||||
Reference in New Issue
Block a user