check order of messages on applied-ops channel

This commit is contained in:
Brian Gough 2019-03-21 14:50:27 +00:00
parent 57c5ec14bd
commit 8c82faa966

View file

@ -3,6 +3,7 @@ settings = require 'settings-sharelatex'
redis = require("redis-sharelatex")
rclient = redis.createClient(settings.redis.documentupdater)
SafeJsonParse = require "./SafeJsonParse"
EventLogger = require "./EventLogger"
MESSAGE_SIZE_LOG_LIMIT = 1024 * 1024 # 1Mb
@ -21,6 +22,8 @@ module.exports = DocumentUpdaterController =
logger.error {err: error, channel}, "error parsing JSON"
return
if message.op?
if message._id?
EventLogger.checkEventOrder(message._id, message)
DocumentUpdaterController._applyUpdateFromDocumentUpdater(io, message.doc_id, message.op)
else if message.error?
DocumentUpdaterController._processErrorFromDocumentUpdater(io, message.doc_id, message.error, message)