From ba4dba24ddb3bb36a091915309ebee3c191d613f Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 30 May 2016 12:29:58 +0200 Subject: [PATCH] If there are no checkpoints, the document fails to sync --- NetfluxWebsocketSrv.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NetfluxWebsocketSrv.js b/NetfluxWebsocketSrv.js index 03889ee8e..d92510749 100644 --- a/NetfluxWebsocketSrv.js +++ b/NetfluxWebsocketSrv.js @@ -106,6 +106,10 @@ const getHistory = function (ctx, channelName, handler, cb) { } //console.log(messageBuf[startPoint]); } + if (cpCount < 2) { + // no checkpoints. + for (var x = msgBuff2.pop(); x; x = msgBuff2.pop()) { handler(x); } + } cb(); }); };