From 15d6f573e7d3f73909988ae4493506885948f1f8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 12 Apr 2021 17:47:45 +0530 Subject: [PATCH] don't send DUPLICATE error --- lib/hk-util.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/hk-util.js b/lib/hk-util.js index cb0d6df9c..7c244c174 100644 --- a/lib/hk-util.js +++ b/lib/hk-util.js @@ -686,7 +686,7 @@ const handleGetHistory = function (Env, Server, seq, userId, parsed) { // If we're asking for a specific version (lastKnownHash) but we receive an // ENOENT, this is not a pad creation so we need to abort. - if (err && err.code === 'ENOENT' && lastKnownHash) { // XXX && lastKnownHash !== -1 + if (err && err.code === 'ENOENT' && lastKnownHash) { /* This informs clients that the pad they're trying to load was deleted by its owner. The user in question might be reconnecting or might have loaded the document from their cache. @@ -918,8 +918,9 @@ HK.onChannelMessage = function (Env, Server, channel, msgStruct, cb) { // more straightforward and reliable. if (Array.isArray(id) && id[2] && id[2] === channel.lastSavedCp) { // Reject duplicate checkpoints - // XXX not an error? the checkpoint is already here so we can assume it's stored - return void cb('DUPLICATE'); + return void cb(); + // not an error? the checkpoint is already here so we can assume it's stored + //return void cb('DUPLICATE'); } }