Skip to content
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

Sliding Sync timeline events and extensions #1054

Merged
merged 29 commits into from
Oct 25, 2022

Conversation

gnunicorn
Copy link
Contributor

@gnunicorn gnunicorn commented Sep 19, 2022

  • general extensions framework
  • E2EE Extension support
  • ToDevice Extension support
  • AccountData Extension support
  • Timeline events support

refs #1014

@gnunicorn gnunicorn marked this pull request as ready for review September 21, 2022 16:06
@gnunicorn gnunicorn requested a review from a team September 21, 2022 16:06
@jplatte
Copy link
Collaborator

jplatte commented Sep 21, 2022

I have just released ruma 0.7.4 with the sliding sync changes.

Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, good work!

crates/matrix-sdk-base/src/sliding_sync.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-base/src/sliding_sync.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-base/src/sliding_sync.rs Show resolved Hide resolved
crates/matrix-sdk/src/sliding_sync.rs Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Base: 73.17% // Head: 73.17% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (773b587) compared to base (9de98df).
Patch coverage: 80.55% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1054   +/-   ##
=======================================
  Coverage   73.17%   73.17%           
=======================================
  Files         110      110           
  Lines       12256    12265    +9     
=======================================
+ Hits         8968     8975    +7     
- Misses       3288     3290    +2     
Impacted Files Coverage Δ
...es/matrix-sdk-common/src/deserialized_responses.rs 62.16% <ø> (ø)
crates/matrix-sdk/src/sliding_sync.rs 0.00% <0.00%> (ø)
crates/matrix-sdk-base/src/client.rs 77.33% <88.46%> (+0.30%) ⬆️
crates/matrix-sdk-crypto/src/machine.rs 66.83% <100.00%> (-0.18%) ⬇️
crates/matrix-sdk/src/sync.rs 71.42% <100.00%> (+2.46%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gnunicorn gnunicorn requested review from a team, Hywan and jplatte September 22, 2022 13:59
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good. One thing beside the nits, now that E2EE is supposed to work with sliding sync and jack-in we need to change the text for the Get access token section.

The way it is, it's going to produce broken E2EE setups. The access token that you can get from Element is already bound to a set of E2EE keys. A new access token needs to be created, either using curl-like tools or jack-in needs to support logging in. Using httpie you can log in using this snippet:

$ https POST https://matrix.org/_matrix/client/v3/login type="m.login.password" password=foo identifier:='{"type": "m.id.user", "user": "@bar:matrix.org"}'

Another jack-in problem, it hardcodes a device id, that won't ever work with E2EE, the following diff lets you configure it:

diff --git a/labs/jack-in/src/main.rs b/labs/jack-in/src/main.rs
index d3b47a41c7..b786f21099 100644
--- a/labs/jack-in/src/main.rs
+++ b/labs/jack-in/src/main.rs
@@ -83,6 +83,10 @@ struct Opt {
     #[structopt(short, long, env = "JACKIN_USER")]
     user: String,
 
+    /// The device ID associated with this access token
+    #[structopt(short, long, env = "JACKIN_DEVICE_ID")]
+    device_id: String,
+
     #[structopt(long)]
     /// Activate tracing and write the flamegraph to the specified file
     flames: Option<PathBuf>,
@@ -112,7 +116,7 @@ async fn main() -> Result<()> {
     let opt = Opt::from_args();
 
     let user_id: OwnedUserId = opt.user.clone().parse()?;
-    let device_id: OwnedDeviceId = "XdftAsd".into();
+    let device_id: OwnedDeviceId = opt.device_id.into();
 
     if let Some(ref p) = opt.flames {
         setup_flames(p.as_path());

Lastly jack-in doesn't seem to work currently with the hosted sliding sync proxy:

image

I'll tag this as requesting changes, since I'll want to retest it once the proxy works.

crates/matrix-sdk-base/src/sliding_sync.rs Show resolved Hide resolved
crates/matrix-sdk-base/Cargo.toml Outdated Show resolved Hide resolved
crates/matrix-sdk/src/sliding_sync.rs Show resolved Hide resolved
@gnunicorn gnunicorn requested a review from poljar October 12, 2022 13:54
@gnunicorn gnunicorn requested a review from a team October 17, 2022 14:08
@poljar
Copy link
Contributor

poljar commented Oct 18, 2022

Seems like the proxy has an issue with one-time key counts, opened matrix-org/sliding-sync#52 for that.

@poljar
Copy link
Contributor

poljar commented Oct 18, 2022

And another, rather critical issue: matrix-org/sliding-sync#53

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're waiting for the sliding sync proxy to start working, the file-logging feature of jack-in doesn't compile anymore.

@gnunicorn gnunicorn requested a review from poljar October 20, 2022 11:30
@gnunicorn gnunicorn force-pushed the ben-sliding-sync-extensions branch 2 times, most recently from 9bf3639 to a3d3973 Compare October 25, 2022 10:51
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, seems like everything works now.

@gnunicorn gnunicorn merged commit a443e72 into matrix-org:main Oct 25, 2022
@gnunicorn gnunicorn deleted the ben-sliding-sync-extensions branch October 25, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants