This PR fixes a bug reported by taronish (via Slack). If a document contained a text object with enough operations to split it across two blocks, and then a root object operation was performed with a higher key than any existing key on the root object, then that operation would be inserted at the beginning of the second block, not after the existing root object operations as it should. Further down the line this would cause exceptions like "RangeError: could not find list element with ID" or "RangeError: no matching operation for pred" even though the operations were valid.
I fixed it by correcting the block skipping logic in seekToOp. Incidentally, the fix was closely related to a simplification of the block metadata that I wanted to do anyway, so I did that simplification at the same time.
This PR fixes a bug reported by taronish (via Slack). If a document contained a text object with enough operations to split it across two blocks, and then a root object operation was performed with a higher key than any existing key on the root object, then that operation would be inserted at the beginning of the second block, not after the existing root object operations as it should. Further down the line this would cause exceptions like "RangeError: could not find list element with ID" or "RangeError: no matching operation for pred" even though the operations were valid.
I fixed it by correcting the block skipping logic in
seekToOp
. Incidentally, the fix was closely related to a simplification of the block metadata that I wanted to do anyway, so I did that simplification at the same time.