Instead of wrapping the following in this if-block, could you do:

```
if (!this.historyUnlocked) {
  return;
}
```
to keep the level of indention smaller?

Why the check for `HISTORY_SIZE`? If the variable is/can be zero, the feature should be disabled as a whole instead.