-
Notifications
You must be signed in to change notification settings - Fork 240
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
Split out the sliding sync loop into two loops #1961
Comments
Some notes from my current implementation for this:
I've got a naive implementation that mostly reproduces the logic of running a sliding-sync request, that could be refactored. Since these changes are non trivial and would move a lot of code, I think it'd make sense to sync about it before I start doing it:
Does it make sense @Hywan? |
Reporting from the quick chat we've had with @Hywan: let's keep |
This is the first PR for splitting the sync loop into two. This offers a new high-level API, `NotificationApi`, that makes use of a separate `SlidingSync` instance which sole role is to listen to to-device events and e2ee; it's pre-configured to do so. That means we're not force-enabling e2ee and to-device by default for every sliding sync instance, and as such we won't either generate Olm requests to the home server in general. In the future, this new high-level API will hide some low-level dirty details so that its can be instantiated in multiple processes at the same time (lock across process, invalidate and refill crypto caches, etc.). An embedder who would want to make use of this would need the following: - a main sliding sync instance, without e2ee and to-device. Using the `matrix_sdk_ui::RoomList` would be the best bet, at this time. - an instance of this `matrix_sdk_ui::NotificationApi`, with a different identifier. Note that this is not ready to be used in an external process; or it will cause the same kind of issues that we're seeing as of today: invalid crypto caches resulting in UTD, etc. Fixes #1961.
This is the first PR for splitting the sync loop into two. This offers a new high-level API, `NotificationApi`, that makes use of a separate `SlidingSync` instance which sole role is to listen to to-device events and e2ee; it's pre-configured to do so. That means we're not force-enabling e2ee and to-device by default for every sliding sync instance, and as such we won't either generate Olm requests to the home server in general. In the future, this new high-level API will hide some low-level dirty details so that its can be instantiated in multiple processes at the same time (lock across process, invalidate and refill crypto caches, etc.). An embedder who would want to make use of this would need the following: - a main sliding sync instance, without e2ee and to-device. Using the `matrix_sdk_ui::RoomList` would be the best bet, at this time. - an instance of this `matrix_sdk_ui::NotificationApi`, with a different identifier. Note that this is not ready to be used in an external process; or it will cause the same kind of issues that we're seeing as of today: invalid crypto caches resulting in UTD, etc. Fixes matrix-org/matrix-rust-sdk#1961.
As described in #1928, it would be beneficial if our sync setup involves two loops which don't block each other.
One loop would be for user facing data, the other one for to-device traffic.
The public API should mostly hide the fact that this is happening. We can likely remove the enabling/disabling of the to-device extension from the public API wholesale.
The text was updated successfully, but these errors were encountered: