diff --git a/services/web/app/src/Features/Compile/ClsiManager.mjs b/services/web/app/src/Features/Compile/ClsiManager.mjs index 5813167152..85b377fa03 100644 --- a/services/web/app/src/Features/Compile/ClsiManager.mjs +++ b/services/web/app/src/Features/Compile/ClsiManager.mjs @@ -894,7 +894,7 @@ async function _buildRequestFromHistoryFull( history: { snapshot: rawSnapshot, changes: rawChanges }, startVersion, }, - } = await HistoryManager.promises.getLatestHistory(historyId) + } = await HistoryManager.promises.getLatestHistoryWithHistoryId(historyId) const rawChangeOperations = _rawChangeOperationsFromChanges(rawChanges) const globalBlobs = _collectGlobalBlobs(rawChangeOperations) for (const { hash, rangesHash } of Object.values(rawSnapshot.files)) { diff --git a/services/web/app/src/Features/History/HistoryManager.mjs b/services/web/app/src/Features/History/HistoryManager.mjs index a1f6bde69e..8874a5a5c2 100644 --- a/services/web/app/src/Features/History/HistoryManager.mjs +++ b/services/web/app/src/Features/History/HistoryManager.mjs @@ -273,6 +273,15 @@ async function getContentAtVersion(projectId, version) { async function getLatestHistory(projectId) { const historyId = await getHistoryId(projectId) + return await getLatestHistoryWithHistoryId(historyId) +} + +/** + * Get the latest chunk from history using already resolved historyId + * + * @param {string} historyId + */ +async function getLatestHistoryWithHistoryId(historyId) { return await fetchJson( `${HISTORY_V1_URL}/projects/${historyId}/latest/history`, { @@ -442,5 +451,6 @@ export default { getChanges, getProjectBlobStats, getBlobStats, + getLatestHistoryWithHistoryId, }, }