Skip to content

Commit f783222

Browse files
authored
Merge branch 'main' into async-callback-infrastructure
Signed-off-by: Daniel Salinas <zzorba@users.noreply.github.com>
2 parents 68f7201 + 6d5ad4e commit f783222

File tree

190 files changed

+11767
-8788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+11767
-8788
lines changed

Cargo.lock

Lines changed: 315 additions & 116 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ reqwest = { version = "0.12.12", default-features = false }
6363
rmp-serde = "1.3.0"
6464
# Be careful to use commits from the https://github.com/ruma/ruma/tree/ruma-0.12
6565
# branch until a proper release with breaking changes happens.
66-
ruma = { git = "https://github.com/ruma/ruma", rev = "689d9613a985edc089b5b729e6d9362f09b5df4f", features = [
66+
ruma = { git = "https://github.com/ruma/ruma", rev = "a8fd1b0322649bf59e2a5cfc73ab4fe46b21edd7", features = [
6767
"client-api-c",
6868
"compat-upload-signatures",
6969
"compat-user-id",
@@ -79,7 +79,9 @@ ruma = { git = "https://github.com/ruma/ruma", rev = "689d9613a985edc089b5b729e6
7979
"unstable-msc4171",
8080
"unstable-msc4278",
8181
] }
82-
ruma-common = { git = "https://github.com/ruma/ruma", rev = "689d9613a985edc089b5b729e6d9362f09b5df4f" }
82+
ruma-common = { git = "https://github.com/ruma/ruma", rev = "a8fd1b0322649bf59e2a5cfc73ab4fe46b21edd7" }
83+
sentry = "0.36.0"
84+
sentry-tracing = "0.36.0"
8385
serde = "1.0.217"
8486
serde_html_form = "0.2.7"
8587
serde_json = "1.0.138"
@@ -101,7 +103,7 @@ url = "2.5.4"
101103
uuid = "1.12.1"
102104
vodozemac = { version = "0.9.0", features = ["insecure-pk-encryption"] }
103105
wasm-bindgen = "0.2.84"
104-
wasm-bindgen-test = "0.3.33"
106+
wasm-bindgen-test = "0.3.50"
105107
web-sys = "0.3.69"
106108
wiremock = "0.6.2"
107109
zeroize = "1.8.1"

benchmarks/benches/room_bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use matrix_sdk_base::{
77
};
88
use matrix_sdk_sqlite::SqliteStateStore;
99
use matrix_sdk_test::{event_factory::EventFactory, JoinedRoomBuilder, StateTestEvent};
10-
use matrix_sdk_ui::{timeline::TimelineFocus, Timeline};
10+
use matrix_sdk_ui::timeline::{TimelineBuilder, TimelineFocus};
1111
use ruma::{
1212
api::client::membership::get_member_events,
1313
device_id,
@@ -182,7 +182,7 @@ pub fn load_pinned_events_benchmark(c: &mut Criterion) {
182182
.await
183183
.unwrap();
184184

185-
let timeline = Timeline::builder(&room)
185+
let timeline = TimelineBuilder::new(&room)
186186
.with_focus(TimelineFocus::PinnedEvents {
187187
max_events_to_load: 100,
188188
max_concurrent_requests: 10,

benchmarks/benches/timeline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
22
use matrix_sdk::test_utils::mocks::MatrixMockServer;
33
use matrix_sdk_test::{event_factory::EventFactory, JoinedRoomBuilder, StateTestEvent};
4-
use matrix_sdk_ui::Timeline;
4+
use matrix_sdk_ui::timeline::TimelineBuilder;
55
use ruma::{
66
events::room::message::RoomMessageEventContentWithoutRelation, owned_room_id, owned_user_id,
77
EventId,
@@ -102,7 +102,7 @@ pub fn create_timeline_with_initial_events(c: &mut Criterion) {
102102
BenchmarkId::new("create_timeline_with_initial_events", format!("{NUM_EVENTS} events")),
103103
|b| {
104104
b.to_async(&runtime).iter(|| async {
105-
let timeline = Timeline::builder(&room)
105+
let timeline = TimelineBuilder::new(&room)
106106
.track_read_marker_and_receipts()
107107
.build()
108108
.await

bindings/matrix-sdk-crypto-ffi/src/machine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,8 @@ impl OlmMachine {
13371337
let (sas, request) = self.runtime.block_on(device.start_verification())?;
13381338

13391339
Some(StartSasResult {
1340-
sas: Sas { inner: sas, runtime: self.runtime.handle().to_owned() }.into(),
1340+
sas: Sas { inner: Box::new(sas), runtime: self.runtime.handle().to_owned() }
1341+
.into(),
13411342
request: request.into(),
13421343
})
13431344
} else {

bindings/matrix-sdk-crypto-ffi/src/responses.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ impl From<&ToDeviceRequest> for Request {
224224
}
225225
}
226226

227-
impl From<&RoomMessageRequest> for Request {
228-
fn from(r: &RoomMessageRequest) -> Self {
227+
impl From<&Box<RoomMessageRequest>> for Request {
228+
fn from(r: &Box<RoomMessageRequest>) -> Self {
229229
Self::RoomMessage {
230230
request_id: r.txn_id.to_string(),
231231
room_id: r.room_id.to_string(),

bindings/matrix-sdk-crypto-ffi/src/verification.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl Verification {
8888
/// returns `None` if the verification is not a `Sas` verification.
8989
pub fn as_sas(&self) -> Option<Arc<Sas>> {
9090
if let InnerVerification::SasV1(sas) = &self.inner {
91-
Some(Sas { inner: sas.to_owned(), runtime: self.runtime.to_owned() }.into())
91+
Some(Sas { inner: sas.clone(), runtime: self.runtime.to_owned() }.into())
9292
} else {
9393
None
9494
}
@@ -98,7 +98,7 @@ impl Verification {
9898
/// returns `None` if the verification is not a `QrCode` verification.
9999
pub fn as_qr(&self) -> Option<Arc<QrCode>> {
100100
if let InnerVerification::QrV1(qr) = &self.inner {
101-
Some(QrCode { inner: qr.to_owned(), runtime: self.runtime.to_owned() }.into())
101+
Some(QrCode { inner: qr.clone(), runtime: self.runtime.to_owned() }.into())
102102
} else {
103103
None
104104
}
@@ -108,7 +108,7 @@ impl Verification {
108108
/// The `m.sas.v1` verification flow.
109109
#[derive(uniffi::Object)]
110110
pub struct Sas {
111-
pub(crate) inner: InnerSas,
111+
pub(crate) inner: Box<InnerSas>,
112112
pub(crate) runtime: Handle,
113113
}
114114

@@ -324,7 +324,7 @@ impl From<QrVerificationState> for QrCodeState {
324324
/// verification flow.
325325
#[derive(uniffi::Object)]
326326
pub struct QrCode {
327-
pub(crate) inner: InnerQr,
327+
pub(crate) inner: Box<InnerQr>,
328328
pub(crate) runtime: Handle,
329329
}
330330

@@ -669,7 +669,7 @@ impl VerificationRequest {
669669
/// verification flow.
670670
pub fn start_sas_verification(&self) -> Result<Option<StartSasResult>, CryptoStoreError> {
671671
Ok(self.runtime.block_on(self.inner.start_sas())?.map(|(sas, r)| StartSasResult {
672-
sas: Arc::new(Sas { inner: sas, runtime: self.runtime.clone() }),
672+
sas: Arc::new(Sas { inner: Box::new(sas), runtime: self.runtime.clone() }),
673673
request: r.into(),
674674
}))
675675
}
@@ -690,7 +690,7 @@ impl VerificationRequest {
690690
Ok(self
691691
.runtime
692692
.block_on(self.inner.generate_qr_code())?
693-
.map(|qr| QrCode { inner: qr, runtime: self.runtime.clone() }.into()))
693+
.map(|qr| QrCode { inner: Box::new(qr), runtime: self.runtime.clone() }.into()))
694694
}
695695

696696
/// Pass data from a scanned QR code to an active verification request and
@@ -717,7 +717,7 @@ impl VerificationRequest {
717717
let request = qr.reciprocate()?;
718718

719719
Some(ScanResult {
720-
qr: QrCode { inner: qr, runtime: self.runtime.clone() }.into(),
720+
qr: QrCode { inner: Box::new(qr), runtime: self.runtime.clone() }.into(),
721721
request: request.into(),
722722
})
723723
} else {

bindings/matrix-sdk-ffi/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Breaking changes:
1919

2020
Additions:
2121

22+
- Support for adding a Sentry layer to the FFI bindings has been added. Only `tracing` statements with
23+
the field `sentry=true` will be forwarded to Sentry, in addition to default Sentry filters.
2224
- Add room topic string to `StateEventContent`
2325
- Add `UploadSource` for representing upload data - this is analogous to `matrix_sdk_ui::timeline::AttachmentSource`
2426
- Add `Client::observe_account_data_event` and `Client::observe_room_account_data_event` to

bindings/matrix-sdk-ffi/Cargo.toml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ matrix-sdk-ui = { workspace = true, features = ["uniffi"] }
3737
mime = "0.3.16"
3838
once_cell = { workspace = true }
3939
ruma = { workspace = true, features = ["html", "unstable-unspecified", "unstable-msc3488", "compat-unset-avatar", "unstable-msc3245-v1-compat", "unstable-msc4278"] }
40+
sentry-tracing = "0.36.0"
4041
serde = { workspace = true }
4142
serde_json = { workspace = true }
4243
thiserror = { workspace = true }
@@ -61,6 +62,32 @@ uniffi = { workspace = true, features = ["tokio"] }
6162
[target.'cfg(target_os = "android")'.dependencies]
6263
paranoid-android = "0.2.1"
6364

65+
[target.'cfg(target_os = "android")'.dependencies.sentry]
66+
version = "0.36.0"
67+
default-features = false
68+
features = [
69+
# TLS lib specific for Android.
70+
"rustls",
71+
# Most default features enabled otherwise.
72+
"backtrace",
73+
"contexts",
74+
"panic",
75+
"reqwest"
76+
]
77+
78+
[target.'cfg(all(not(target_os = "android")), not(target_arch = "wasm32")))'.dependencies.sentry]
79+
version = "0.36.0"
80+
default-features = false
81+
features = [
82+
# TLS lib used on non-Android platforms.
83+
"native-tls",
84+
# Most default features enabled otherwise.
85+
"backtrace",
86+
"contexts",
87+
"panic",
88+
"reqwest"
89+
]
90+
6491
[target.'cfg(target_arch = "wasm32")'.dependencies.matrix-sdk]
6592
workspace = true
6693
features = [
@@ -74,7 +101,7 @@ features = [
74101
"uniffi",
75102
]
76103

77-
[target.'cfg(all(target_os = "android", not(target_arch = "wasm32")))'.dependencies.matrix-sdk]
104+
[target.'cfg(target_os = "android")'.dependencies.matrix-sdk]
78105
workspace = true
79106
features = [
80107
"anyhow",

0 commit comments

Comments
 (0)