From 06668fd6a8ec8d5510d98c921a5a2b8c30c7ebaf Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 16 Feb 2026 17:23:29 +0100 Subject: [PATCH] [document-updater] add more context to docs without historyId in redis (#31570) GitOrigin-RevId: 99cf9629d5393e980b14e096377122acf46ff5ed --- .../scripts/flush_projects_with_no_history_id.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/services/document-updater/scripts/flush_projects_with_no_history_id.js b/services/document-updater/scripts/flush_projects_with_no_history_id.js index 586edda08d..80b6ddb042 100644 --- a/services/document-updater/scripts/flush_projects_with_no_history_id.js +++ b/services/document-updater/scripts/flush_projects_with_no_history_id.js @@ -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 },