From bc034d95a3ade10252b151a3ecfd525d75fcba2d Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 12 Mar 2020 11:13:23 -0400 Subject: [PATCH] enforce asynchrony in 'gethistoryOffset' --- lib/hk-util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/hk-util.js b/lib/hk-util.js index 3f0aed360..cb9e9b8ef 100644 --- a/lib/hk-util.js +++ b/lib/hk-util.js @@ -436,7 +436,8 @@ const storeMessage = function (Env, channel, msg, isCp, optionalMessageHash) { * -1 if you didn't find it */ -const getHistoryOffset = (Env, channelName, lastKnownHash, cb) => { +const getHistoryOffset = (Env, channelName, lastKnownHash, _cb) => { + const cb = Util.once(Util.mkAsync(_cb)); const store = Env.store; const Log = Env.Log;