|
|
@ -662,10 +662,11 @@ const handleGetHistoryRange = function (Env, Server, seq, userId, parsed) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var oldestKnownHash = map.from;
|
|
|
|
var oldestKnownHash = map.from;
|
|
|
|
|
|
|
|
var untilHash = map.to;
|
|
|
|
var desiredMessages = map.count;
|
|
|
|
var desiredMessages = map.count;
|
|
|
|
var desiredCheckpoint = map.cpCount;
|
|
|
|
var desiredCheckpoint = map.cpCount;
|
|
|
|
var txid = map.txid;
|
|
|
|
var txid = map.txid;
|
|
|
|
if (typeof(desiredMessages) !== 'number' && typeof(desiredCheckpoint) !== 'number') {
|
|
|
|
if (typeof(desiredMessages) !== 'number' && typeof(desiredCheckpoint) !== 'number' && !untilHash) {
|
|
|
|
return void Server.send(userId, [seq, 'ERROR', 'UNSPECIFIED_COUNT', HISTORY_KEEPER_ID]);
|
|
|
|
return void Server.send(userId, [seq, 'ERROR', 'UNSPECIFIED_COUNT', HISTORY_KEEPER_ID]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -674,7 +675,7 @@ const handleGetHistoryRange = function (Env, Server, seq, userId, parsed) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Server.send(userId, [seq, 'ACK']);
|
|
|
|
Server.send(userId, [seq, 'ACK']);
|
|
|
|
Env.getOlderHistory(channelName, oldestKnownHash, desiredMessages, desiredCheckpoint, function (err, toSend) {
|
|
|
|
Env.getOlderHistory(channelName, oldestKnownHash, untilHash, desiredMessages, desiredCheckpoint, function (err, toSend) {
|
|
|
|
if (err && err.code !== 'ENOENT') {
|
|
|
|
if (err && err.code !== 'ENOENT') {
|
|
|
|
Env.Log.error("HK_GET_OLDER_HISTORY", err);
|
|
|
|
Env.Log.error("HK_GET_OLDER_HISTORY", err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|