Просмотр исходного кода

Merge pull request #17713 from overleaf/em-resync-include-ranges

Add ranges to resync doc update

GitOrigin-RevId: 6998b952028a154c21c8f476e0504496019aea9c
Eric Mc Sween 2 лет назад
Родитель
Сommit
5d2aed3b1c

+ 5 - 0
services/document-updater/app/js/ProjectHistoryRedisManager.js

@@ -168,6 +168,11 @@ const ProjectHistoryRedisManager = {
         ts: new Date(),
         ts: new Date(),
       },
       },
     }
     }
+
+    if (historyRangesSupport) {
+      projectUpdate.resyncDocContent.ranges = ranges
+    }
+
     const jsonUpdate = JSON.stringify(projectUpdate)
     const jsonUpdate = JSON.stringify(projectUpdate)
     // Do an optimised size check on the docLines using the serialised
     // Do an optimised size check on the docLines using the serialised
     // project update length as an upper bound
     // project update length as an upper bound

+ 1 - 0
services/document-updater/test/unit/js/ProjectHistoryRedisManager/ProjectHistoryRedisManagerTests.js

@@ -260,6 +260,7 @@ describe('ProjectHistoryRedisManager', function () {
             resyncDocContent: {
             resyncDocContent: {
               content: 'onedeleted\ntwo',
               content: 'onedeleted\ntwo',
               version: this.version,
               version: this.version,
+              ranges: this.ranges,
             },
             },
             projectHistoryId: this.projectHistoryId,
             projectHistoryId: this.projectHistoryId,
             path: this.pathname,
             path: this.pathname,