In HistoryTreeBackendIterator, the time range condition for queuing children nodes is reduced according to the current node time range.
During construction, it can happen that the root node has a time range that is only the start timestamp. In that case the iterator will only consider child nodes that intersect with the start time and all other child nodes will be discarded. The iterator can then miss many intersecting intervals.
The root node time range can be increased if intervals are added to it (this does not always happen) or at the end of construction when the node is closed.
A solution seems to be to avoid reducing the time range condition when the current node is the root node.
In HistoryTreeBackendIterator, the time range condition for queuing children nodes is reduced according to the current node time range.
During construction, it can happen that the root node has a time range that is only the start timestamp. In that case the iterator will only consider child nodes that intersect with the start time and all other child nodes will be discarded. The iterator can then miss many intersecting intervals.
The root node time range can be increased if intervals are added to it (this does not always happen) or at the end of construction when the node is closed.
A solution seems to be to avoid reducing the time range condition when the current node is the root node.