From 4037270a23e8ab713ad1cf6cc96df3210ac36c36 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 4 May 2020 15:46:08 -0400 Subject: [PATCH] add a FIXME note for a sketchy implementation in history keeper --- lib/hk-util.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/hk-util.js b/lib/hk-util.js index 81984b300..ccf8c4465 100644 --- a/lib/hk-util.js +++ b/lib/hk-util.js @@ -836,6 +836,9 @@ HK.onChannelMessage = function (Env, Server, channel, msgStruct) { if (isCp) { // id becomes either null or an array or results... id = CHECKPOINT_PATTERN.exec(msgStruct[4]); + // FIXME relying on this data to be stored on an in-memory structure + // managed by a dependency is fragile. We should put this somewhere + // more straightforward and reliable. if (Array.isArray(id) && id[2] && id[2] === channel.lastSavedCp) { // Reject duplicate checkpoints return; @@ -901,6 +904,8 @@ HK.onChannelMessage = function (Env, Server, channel, msgStruct) { // FIXME if (Array.isArray(id) && id[2]) { // Store new checkpoint hash + // there's a FIXME above which concerns a reference to `lastSavedCp` + // this is a hacky place to store important data. channel.lastSavedCp = id[2]; } }