From 24343a38cda28f600ded2e6c6da343f79e316a3d Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 1 May 2014 10:26:01 +0100 Subject: [PATCH] Add error handling of mismatched versions back in --- services/track-changes/app/coffee/UpdatesManager.coffee | 2 -- .../test/unit/coffee/UpdatesManager/UpdatesManagerTests.coffee | 2 -- 2 files changed, 4 deletions(-) diff --git a/services/track-changes/app/coffee/UpdatesManager.coffee b/services/track-changes/app/coffee/UpdatesManager.coffee index 4b8c798fa6..e0e531e957 100644 --- a/services/track-changes/app/coffee/UpdatesManager.coffee +++ b/services/track-changes/app/coffee/UpdatesManager.coffee @@ -22,7 +22,6 @@ module.exports = UpdatesManager = while rawUpdates[0]? and rawUpdates[0].v <= lastCompressedUpdate.v rawUpdates.shift() - ### TODO: Restore this when errors have died down after the Sunday crash. if rawUpdates[0]? and rawUpdates[0].v != lastCompressedUpdate.v + 1 error = new Error("Tried to apply raw op at version #{rawUpdates[0].v} to last compressed update with version #{lastCompressedUpdate.v}") logger.error err: error, doc_id: doc_id, project_id: project_id, "inconsistent doc versions" @@ -31,7 +30,6 @@ module.exports = UpdatesManager = MongoManager.insertCompressedUpdates project_id, doc_id, [lastCompressedUpdate], () -> return callback error return - ### compressedUpdates = UpdateCompressor.compressRawUpdates lastCompressedUpdate, rawUpdates MongoManager.insertCompressedUpdates project_id, doc_id, compressedUpdates, (error) -> diff --git a/services/track-changes/test/unit/coffee/UpdatesManager/UpdatesManagerTests.coffee b/services/track-changes/test/unit/coffee/UpdatesManager/UpdatesManagerTests.coffee index ac302da5c4..0e50ee3e20 100644 --- a/services/track-changes/test/unit/coffee/UpdatesManager/UpdatesManagerTests.coffee +++ b/services/track-changes/test/unit/coffee/UpdatesManager/UpdatesManagerTests.coffee @@ -104,7 +104,6 @@ describe "UpdatesManager", -> .calledWith(@lastCompressedUpdate, @rawUpdates.slice(-2)) .should.equal true - ### describe "when the raw ops do not follow from the last compressed op version", -> beforeEach -> @rawUpdates = [{ v: 13, op: "mock-op-13" }] @@ -120,7 +119,6 @@ describe "UpdatesManager", -> @MongoManager.insertCompressedUpdates .calledWith(@project_id, @doc_id, [@lastCompressedUpdate]) .should.equal true - ### describe "processUncompressedUpdates", -> beforeEach ->