mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 15:49:01 +02:00
Merge pull request #31971 from overleaf/jpa-fix-compile-old-projects
[web] fix compile from history for old projects GitOrigin-RevId: d46dc3bbcd60dd6d7d74809e0b4e2619b7bd9b49
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user