-
Notifications
You must be signed in to change notification settings - Fork 305
feat: Implement App
API
#2204
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
feat: Implement App
API
#2204
Conversation
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.
Very nice, I think all of it makes sense. If we can remove the ability to disable E2EE on the main client, that would be even better.
crates/matrix-sdk-ui/src/app/mod.rs
Outdated
self | ||
} | ||
|
||
pub fn with_encryption_sync(mut self) -> Self { |
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.
As mentioned in the Matrix room, do we need this? Can't we make it always true?
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.
I think that's needed until we enable the encryption sync by default... which should be the case any time now.
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.
Alright, once we do that, please let us remove this as well.
|
||
pub struct App { | ||
room_list: Arc<RoomListService>, | ||
encryption_sync: Option<Arc<EncryptionSync>>, |
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.
If we're always going to have an EncryptionSync
then we don't need an optional here. We could #[cfg(feature = "e2e-encryption")]
this field if we want to support clients that don't use E2EE.
// and the loop to terminate. | ||
|
||
loop { | ||
tokio::select! { |
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.
Nice use of a select!
.
8e286f9
to
a24495a
Compare
App
and NotificationClient
APIsApp
API
Tested and works pretty well on the iOS side, makes the code easier to read a decouples a lot of responsibilities from the client, love it! |
a24495a
to
cc92444
Compare
Thanks a bunch Mauro for trying it 🥳 This is now ready for review, since the I still am not fond of the |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #2204 +/- ##
==========================================
- Coverage 76.73% 76.64% -0.09%
==========================================
Files 172 173 +1
Lines 18060 18081 +21
==========================================
Hits 13858 13858
- Misses 4202 4223 +21
☔ View full report in Codecov by Sentry. |
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.
Looks good. Not a fan of the App
name either, but we can bikeshed later on.
This implements a very high-level
App
API that takes care of all the sliding syncs:with_encryption_sync
, then it will spawn two sliding syncs, one for the room list, one for e2ee. It can be configured to run with the cross-process crypto store lock or not (for the needs of Element X iOS).Fixes #1928.
This is based on top of #2235, as the final commits get rid of ways to manually create (and misconfigure)
EncryptionSync
and theRoomListService
\o/