Merge pull request #64 from overleaf/bg-make-event-order-check-configurable

make event order check a configuration setting
This commit is contained in:
Brian Gough 2019-07-17 13:47:15 +01:00 committed by GitHub
commit b8c152ad12
3 changed files with 4 additions and 2 deletions

View file

@ -34,7 +34,7 @@ module.exports = DocumentUpdaterController =
logger.error {err: error, channel}, "error parsing JSON" logger.error {err: error, channel}, "error parsing JSON"
return return
if message.op? if message.op?
if message._id? if message._id? && settings.checkEventOrder
status = EventLogger.checkEventOrder("applied-ops", message._id, message) status = EventLogger.checkEventOrder("applied-ops", message._id, message)
if status is 'duplicate' if status is 'duplicate'
return # skip duplicate events return # skip duplicate events

View file

@ -41,7 +41,7 @@ module.exports = WebsocketLoadBalancer =
if message.room_id == "all" if message.room_id == "all"
io.sockets.emit(message.message, message.payload...) io.sockets.emit(message.message, message.payload...)
else if message.room_id? else if message.room_id?
if message._id? if message._id? && Settings.checkEventOrder
status = EventLogger.checkEventOrder("editor-events", message._id, message) status = EventLogger.checkEventOrder("editor-events", message._id, message)
if status is "duplicate" if status is "duplicate"
return # skip duplicate events return # skip duplicate events

View file

@ -52,6 +52,8 @@ settings =
continualPubsubTraffic: process.env['CONTINUAL_PUBSUB_TRAFFIC'] or false continualPubsubTraffic: process.env['CONTINUAL_PUBSUB_TRAFFIC'] or false
checkEventOrder: process.env['CHECK_EVENT_ORDER'] or false
sentry: sentry:
dsn: process.env.SENTRY_DSN dsn: process.env.SENTRY_DSN