fix(sdk): Remove SlidingSyncInner::past_positions
#3833
Merged
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.
The patch #2395 has introduced
SlidingSyncInner::past_positions
as a mechanism to filter duplicated responses. It was a problem because the sliding syncops
could easily create corrupted states if they were applied more than once.Since #3664,
ops
are ignored.Now,
past_positions
create a problem with the sliding sync native implementation inside Synapse becausepos
can stay the same between multiple responses.While
past_positions
was helpful to fix bugs in the past, it's no longer necessary today. Moreover, it breaks an invariant aboutpos
: we must consider it as a blackbox. It means we must ignore if apos
value has been received in the past or not. This invariant has been broken for good reasons, but it now creates new issues.This patch removes
past_positions
, along with the associated code (likeError::ResponseAlreadyReceived
for example).