feat: Migrate from Sliding Sync to Simplified Sliding Sync#3676
feat: Migrate from Sliding Sync to Simplified Sliding Sync#3676Hywan merged 11 commits intomatrix-org:mainfrom
Conversation
7260887 to
f82dc72
Compare
f82dc72 to
c7979cb
Compare
afbecf0 to
6181db3
Compare
bnjbvr
left a comment
There was a problem hiding this comment.
Please request another round of review when the PR is stable and there are no new commits while I'm reviewing :)
5fb806d to
1b5ecaa
Compare
6cf2ec1 to
0bd5ec3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3676 +/- ##
==========================================
- Coverage 84.37% 84.01% -0.37%
==========================================
Files 260 260
Lines 26783 26700 -83
==========================================
- Hits 22598 22431 -167
- Misses 4185 4269 +84 ☔ View full report in Codecov by Sentry. |
bnjbvr
left a comment
There was a problem hiding this comment.
Cool to see SSS coming to life, I appreciate the amount of work on this and done in Ruma under the hood 👏
There are a few strong no-noes in that PR that make it impossible to land in the current shape.
9961db5 should be in Ruma, not in our code. Too many code smells, likely too hard to maintain in the long term.
a9f22d1 was super hard to review. From a glance, it would have seemed much much simpler to review if it were split into smaller commits:
- get rid of the delta token (to fuse with the latest commit)
- get rid of the unsubscribe mechanism (why can we do that? we still have to support SS as it is right now)
- remove the
::ssnamespacing in most of the code - rename the
recency_timestamptorecency_stampand associated code
I understand that all these changes must come before the actual migration from SS to SSS, but it would've been much much simpler to review if those changes were smaller (usually when i see a commit titled "rename X to Y", if i agree with the renaming i'll skim the code real-quick, and that takes me much less time, than trying to disentangle many changes that live in the same commit).
Pretty sure there's a big regression for SS, since we get rid of the unsubscribe() mechanism a bit too early in the patch set.
Also: do we need a8a1315? I thought we said that having static configuration was sufficient…
4c16797 to
96e8d1b
Compare
poljar
left a comment
There was a problem hiding this comment.
I think that this looks fine, the PR is a bit chunky but most of it are type swaps.
I left some small nits, feel free to merge once addressed. Bonus points if you get the history cleaned up as well.
da7e129 to
00b6bbc
Compare
…eld. This patch is the first over two patches to change the support of Simplified MSC3575 from a compiler feature flag to a runtime configuration. This configuration is held by the `Client`. By default, it's turned off inside `matrix-sdk-ffi` and `matrix-sdk-integration-testing`, otherwise it's turned on.
This patch moves the `sliding_sync` file into its own module.
This patch creates an `http` module containing all the sliding sync types types (from Simplified MSC3575 or simply MSC3575).
…nc_once`. This patch extracts most of `SlidingSync::sync_once` into a method named `SlidingSync::send_sync_request`. The name mimics the `SlidingSync::generate_sync_request` similar method: first we _generate_, then we _send_. The `SlidingSync::send_sync_request` is generic over the `Request` and `::sync_once` passes the correct type depending of whether Simplified MSC3575 is enabled.
Simplified sliding sync no longer has the concept of unsubscribing from a room. This patch removes this API.
This patch renames “recency timestamp” to “recency stamp”. It prepares the fact that simplified sliding sync has a `bump_stamp` instead of a `timestamp`. The notion of _timestamp_ must be removed.
Simplified sliding sync no longer has the `is_tombstoned` filter. This patch removes it.
Simplified sliding sync no longer has `sort` or `bump_event_types` because they are static values on the implementation/server side. This patch removes them here.
Simplified sliding sync doesn't have `delta_token`. This patch removes it. Note: even the current sliding sync proxy doesn't use it.
00b6bbc to
34bcd6d
Compare
…g sync. This patch migrates the entire SDK to sliding sync to simplified sliding sync.
34bcd6d to
07b2004
Compare
We want to support the Simplified MSC3575 (temporary name).
This PR should be reviewed patch-by-patch. It's not super complex, but you need to understand the approach:
matrix_sdk_base::sliding_sync::httpmodule, which provides all the HTTP types for MSC3575,ruma: it's just type aliases at this point, but it's important for the next steps; tl;dr:s/ruma::…::sync::v4/matrix_sdk_base::sliding_sync::http:ss,httpmodule then provides HTTP types for Simplified MSC3575 (!) + conversions from MSC3575 to Simplified MSC3575, and exposes Simplfied MSC3575 as the default types,s/http:ss/http+ remove features from MSC3575 that are no longer used in Simplified MSC3575 (likesort,bump_event_types,unsubscribe_rooms) or rename some features (liketimestamptobump_stamp),Requestinto a MSC3575Requestand the opposite for theResponse. It's done with aexperimental-not-simplified-sliding-syncflag.experimental-not-simplified-sliding-syncturned to be difficult to use esp. when testing the whole project with--workspace. Instead, we went a bit further and replace this compiler feature flag by a runtime configuration on theClientwithClient::is_simplified_sliding_sync_enabled. That way we can decide at runtime if we want Simplified MSC3575 or the ol' MSC3575.Why this approach?
Client::is_simplified_sliding_sync_enabled