[web] Avoid double indexing of client side referencing (#28235)

* [web] Move chat client id to shared module

* [web] Avoid double indexing of client references

GitOrigin-RevId: 993930e66fdc9952649e3e8d345c70dd37516121
This commit is contained in:
Mathias Jakobsen
2025-09-08 08:05:14 +00:00
committed by Copybot
parent 644db1722e
commit 442c1952ab
7 changed files with 37 additions and 17 deletions
@@ -19,7 +19,7 @@ let ReferencesController
export default ReferencesController = {
indexAll(req, res, next) {
const projectId = req.params.Project_id
const { shouldBroadcast } = req.body
const { shouldBroadcast, clientId } = req.body
return ReferencesHandler.indexAll(projectId, function (error, data) {
if (error) {
OError.tag(error, 'failed to index references', { projectId })
@@ -31,12 +31,21 @@ export default ReferencesController = {
projectId,
shouldBroadcast,
true,
data
data,
clientId
)
})
},
_handleIndexResponse(req, res, projectId, shouldBroadcast, isAllDocs, data) {
_handleIndexResponse(
req,
res,
projectId,
shouldBroadcast,
isAllDocs,
data,
clientId
) {
if (data == null || data.keys == null) {
return res.json({ projectId, keys: [] })
}
@@ -45,7 +54,8 @@ export default ReferencesController = {
projectId,
'references:keys:updated',
data.keys,
isAllDocs
isAllDocs,
clientId
)
}
return res.json(data)