Merge pull request #7845 from overleaf/bg-snapshot-lost-tracked-changes

[document-updater] consider lost tracked-changes as collapsed ranges

GitOrigin-RevId: cf8e15c610f906f1296fdcdd69128ad1e029863a
This commit is contained in:
Brian Gough 2022-05-09 14:07:25 +01:00 committed by Copybot
parent 3a81428ef3
commit 8bffacb2ba

View file

@ -80,7 +80,9 @@ module.exports = RangesManager = {
const [emptyRangeCountAfter, totalRangeCountAfter] =
RangesManager._emptyRangesCount(rangesTracker)
const rangesWereCollapsed = emptyRangeCountAfter > emptyRangeCountBefore
const rangesWereCollapsed =
emptyRangeCountAfter > emptyRangeCountBefore ||
totalRangeCountAfter + 1 < totalRangeCountBefore // also include the case where multiple ranges were removed
// monitor the change in range count, we may want to snapshot before large decreases
if (totalRangeCountAfter < totalRangeCountBefore) {
Metrics.histogram(