-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(sdk): Remove RoomListEntry
and ops
in Sliding Sync
#3664
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hywan
force-pushed
the
feat-sdk-sliding-sync-remove-ops
branch
from
July 8, 2024 15:57
68e5b70
to
37c4522
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3664 +/- ##
==========================================
- Coverage 84.27% 84.26% -0.01%
==========================================
Files 259 258 -1
Lines 26662 26530 -132
==========================================
- Hits 22469 22356 -113
+ Misses 4193 4174 -19 ☔ View full report in Codecov by Sentry. |
This patch removes everything related to the computation of `ops` from a sliding sync response. With the recent `RoomList`'s client-side sorting project, we no longer need to handle these `ops`. Moreover, the simplified sliding sync specification that is coming removes the `ops`. A `SlidingSyncList` was containing a `rooms` field. It's removed by this patch. Consequently, all the `SlidingSyncList::room_list` and `::room_list_stream` methods are also removed. A `FrozenSlidingSyncList` was containing the `FrozenSlidingSyncRoom`. This patch moves the `FrozenSlidingSyncRoom`s inside `FrozenSlidingSync`. Why is it still correct? We only want to keep the `SlidingSyncRoom::timeline_queue` in the cache for the moment (until the `EventCache` has a persistent storage). Since a `SlidingSyncList` no longer holds any information about the rooms, and since `SlidingSync` itself has all the `SlidingSyncRoom`, this move is natural and still valid. Bye bye all this code :'-).
Hywan
force-pushed
the
feat-sdk-sliding-sync-remove-ops
branch
from
July 9, 2024 07:57
37c4522
to
cd8dc22
Compare
andybalaam
approved these changes
Jul 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay for deleting code!
Hywan
added a commit
to Hywan/matrix-rust-sdk
that referenced
this pull request
Aug 12, 2024
The patch matrix-org#2395 has introduced `SlidingSyncInner::past_positions` as a mechanism to filter duplicated responses. It was a problem because the sliding sync `ops` could easily create corrupted states if they were applied more than once. Since matrix-org#3664, `ops` are ignored. Now, `past_positions` create a problem with the sliding sync native implementation inside Synapse because `pos` 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 about `pos`: we must consider it as a blackbox. It means we must ignore if a `pos` 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 (like `Error::ResponseAlreadyReceived` for example).
Hywan
added a commit
to Hywan/matrix-rust-sdk
that referenced
this pull request
Aug 12, 2024
The patch matrix-org#2395 has introduced `SlidingSyncInner::past_positions` as a mechanism to filter duplicated responses. It was a problem because the sliding sync `ops` could easily create corrupted states if they were applied more than once. Since matrix-org#3664, `ops` are ignored. Now, `past_positions` create a problem with the sliding sync native implementation inside Synapse because `pos` 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 about `pos`: we must consider it as a blackbox. It means we must ignore if a `pos` 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 (like `Error::ResponseAlreadyReceived` for example).
Hywan
added a commit
that referenced
this pull request
Aug 12, 2024
The patch #2395 has introduced `SlidingSyncInner::past_positions` as a mechanism to filter duplicated responses. It was a problem because the sliding sync `ops` 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 because `pos` 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 about `pos`: we must consider it as a blackbox. It means we must ignore if a `pos` 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 (like `Error::ResponseAlreadyReceived` for example).
bnjbvr
pushed a commit
that referenced
this pull request
Aug 12, 2024
The patch #2395 has introduced `SlidingSyncInner::past_positions` as a mechanism to filter duplicated responses. It was a problem because the sliding sync `ops` 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 because `pos` 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 about `pos`: we must consider it as a blackbox. It means we must ignore if a `pos` 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 (like `Error::ResponseAlreadyReceived` for example).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This patch removes everything related to the computation of
ops
from a sliding sync response. With the recentRoomList
's client-side sorting project, we no longer need to handle theseops
. Moreover, the simplified sliding sync specification that is coming removes theops
.A
SlidingSyncList
was containing arooms
field. It's removed by this patch. Consequently, all theSlidingSyncList::room_list
and::room_list_stream
methods are also removed.A
FrozenSlidingSyncList
was containing theFrozenSlidingSyncRoom
. This patch moves theFrozenSlidingSyncRoom
s insideFrozenSlidingSync
. Why is it still correct? We only want to keep theSlidingSyncRoom::timeline_queue
in the cache for the moment (until theEventCache
has a persistent storage). Since aSlidingSyncList
no longer holds any information about the rooms, and sinceSlidingSync
itself has all theSlidingSyncRoom
, this move is natural and still valid.Bye bye all this code :'-).