sliding sync: handle lone DELETE and INSERT operations #2610
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you leave a room you can get a lone DELETE op.
If you join a room you can get a lone INSERT op.
Up until now, we've assumed these operations happen at the ends
of the list (e.g [0] or [length-1]) which is not guaranteed as it
depends on the sort order (e.g sort alphabetically and join a room
called 'D'). In this scenario, the indexes would not be tracked
correctly. Fixed with integration tests.
Checklist
Notes: fixed a sliding sync bug which could cause the
roomIndexToRoomId
map to be incorrect when a new room is added in the middle of the list or when an existing room is deleted from the middle of the list.Here's what your changelog entry will look like:
🐛 Bug Fixes
roomIndexToRoomId
map to be incorrect when a new room is added in the middle of the list or when an existing room is deleted from the middle of the list. (#2610).