[document-updater] add more context to docs without historyId in redis (#31570)

GitOrigin-RevId: 99cf9629d5393e980b14e096377122acf46ff5ed
This commit is contained in:
Jakob Ackermann
2026-02-17 09:05:22 +00:00
committed by Copybot
parent c4b00104d1
commit 06668fd6a8
@@ -96,15 +96,18 @@ async function findDocsWithMissingHistoryIds(node, docIds) {
.map(docId => [
docUpdaterKeys.docVersion({ doc_id: docId }),
docUpdaterKeys.projectHistoryId({ doc_id: docId }),
docUpdaterKeys.lastUpdatedAt({ doc_id: docId }),
docUpdaterKeys.unflushedTime({ doc_id: docId }),
])
.flat()
)
const results = []
const nKeysPerDoc = 4
for (const [index, docId] of docIds.entries()) {
const docVersion = fromRedis[index * 2]
const historyId = fromRedis[index * 2 + 1]
const [docVersion, historyId, lastUpdatedAt, unflushedTime] =
fromRedis.slice(index * nKeysPerDoc, index * nKeysPerDoc + nKeysPerDoc)
if (!docVersion) {
// Already removed from redis.
continue
@@ -112,7 +115,14 @@ async function findDocsWithMissingHistoryIds(node, docIds) {
if (!historyId) {
try {
const { projectId, historyId } = await getHistoryId(docId)
results.push({ projectId, historyId, docId, docVersion })
results.push({
projectId,
historyId,
docId,
docVersion,
lastUpdatedAt,
unflushedTime,
})
} catch (error) {
logger.warn(
{ error },