From d44432f698499f3e13097176a801ac73669ec2bc Mon Sep 17 00:00:00 2001 From: Sai Raj <39055732+sairajzero@users.noreply.github.com> Date: Wed, 16 Oct 2019 19:37:04 +0530 Subject: [PATCH] update request to send only after given vectorClock --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e324d32..c0d4fb6 100644 --- a/index.html +++ b/index.html @@ -5353,11 +5353,11 @@ try { request = request.split(" "); if (floGlobals.storageList.includes(request[1])) - compactIDB.searchData(request[1], (k, v) => { return (v.receiverID == request[2]) }) + compactIDB.searchData(request[1], (k, v) => { return (k > request[3] && v.application == request[1] && v.receiverID == request[2]) }) .then(result => floSupernode.supernodeClientWS.send(`${request[0]} ${JSON.stringify(result)}`)) .catch(error => console.log(error)) else - compactIDB.searchData(floGlobals.defaultStorage, (k, v) => { return (v.application == request[1] && v.receiverID == request[2]) }) + compactIDB.searchData(floGlobals.defaultStorage, (k, v) => { return (k > request[3] && v.application == request[1] && v.receiverID == request[2]) }) .then(result => floSupernode.supernodeClientWS.send(`${request[0]} ${JSON.stringify(result)}`)) .catch(error => console.log(error))