overleaf/server-ce/hotfix/3.5.12/fix-matching-version-error.patch
Jakob Ackermann d9db49d565 Merge pull request #14962 from overleaf/jpa-server-pro-3-5-12
[server-pro] add hotfix 3.5.12 for fixing matching version error

GitOrigin-RevId: 38611806f6226ad9c7331b5868aa112ced16abd0
2023-09-26 08:03:58 +00:00

22 lines
606 B
Diff

--- services/track-changes/app/js/ZipManager.js
+++ services/track-changes/app/js/ZipManager.js
@@ -95,6 +95,19 @@ async function rewindDoc(projectId, docId, zipfile) {
continue
}
+ if (previousUpdate && update.v >= previousUpdate.v) {
+ logger.warn(
+ {
+ projectId,
+ docId,
+ previousUpdateVersion: previousUpdate.v,
+ updateVersion: update.v,
+ },
+ 'adjusting version for update with matching version'
+ )
+ update.v = previousUpdate.v - 1
+ }
+
const updatePath = `${id}/updates/${update.v}`
try {