From d9db49d565a38ee7ff7f9cb6c4a45e0db0a9701c Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 25 Sep 2023 12:23:00 +0200 Subject: [PATCH] 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 --- server-ce/hotfix/3.5.12/Dockerfile | 5 +++++ .../3.5.12/fix-matching-version-error.patch | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 server-ce/hotfix/3.5.12/Dockerfile create mode 100644 server-ce/hotfix/3.5.12/fix-matching-version-error.patch diff --git a/server-ce/hotfix/3.5.12/Dockerfile b/server-ce/hotfix/3.5.12/Dockerfile new file mode 100644 index 0000000000..a6eef508b2 --- /dev/null +++ b/server-ce/hotfix/3.5.12/Dockerfile @@ -0,0 +1,5 @@ +FROM sharelatex/sharelatex:3.5.11 + +# Patch: fix matching version when rewinding history +COPY fix-matching-version-error.patch . +RUN patch -p0 < fix-matching-version-error.patch diff --git a/server-ce/hotfix/3.5.12/fix-matching-version-error.patch b/server-ce/hotfix/3.5.12/fix-matching-version-error.patch new file mode 100644 index 0000000000..dd768c283d --- /dev/null +++ b/server-ce/hotfix/3.5.12/fix-matching-version-error.patch @@ -0,0 +1,22 @@ +--- 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 {