Skip to content

Commit

Permalink
Merge branch 'main' into valere/support_for_withheld_reason
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Nov 30, 2024
2 parents b853123 + d1a6956 commit 5173b5a
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 57 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bindings_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
test-apple:
name: matrix-rust-components-swift
needs: xtask
runs-on: macos-14
runs-on: macos-15
if: github.event_name == 'push' || !github.event.pull_request.draft

steps:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
run: swift test

- name: Build Framework
run: target/debug/xtask swift build-framework --target=aarch64-apple-ios --profile=dev
run: target/debug/xtask swift build-framework --target=aarch64-apple-ios --profile=release

complement-crypto:
name: "Run Complement Crypto tests"
Expand All @@ -186,7 +186,7 @@ jobs:

test-crypto-apple-framework-generation:
name: Generate Crypto FFI Apple XCFramework
runs-on: macos-14
runs-on: macos-15
if: github.event_name == 'push' || !github.event.pull_request.draft

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/xtask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
os-name: 🐧
cachekey-id: linux

- os: macos-14
- os: macos-15
os-name: 🍏
cachekey-id: macos

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/matrix-sdk-base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(target_arch = "wasm32", allow(clippy::arc_with_non_send_sync))]
#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation.
#![warn(missing_docs, missing_debug_implementations)]

pub use matrix_sdk_common::*;
Expand Down
73 changes: 34 additions & 39 deletions crates/matrix-sdk-base/src/rooms/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,7 @@ mod tests {
use matrix_sdk_common::deserialized_responses::SyncTimelineEvent;
use matrix_sdk_test::{
async_test,
event_factory::EventFactory,
test_json::{sync_events::PINNED_EVENTS, TAG},
ALICE, BOB, CAROL,
};
Expand All @@ -1879,10 +1880,7 @@ mod tests {
room::{
canonical_alias::RoomCanonicalAliasEventContent,
encryption::{OriginalSyncRoomEncryptionEvent, RoomEncryptionEventContent},
member::{
MembershipState, RoomMemberEventContent, StrippedRoomMemberEvent,
SyncRoomMemberEvent,
},
member::{MembershipState, RoomMemberEventContent, StrippedRoomMemberEvent},
name::RoomNameEventContent,
pinned_events::RoomPinnedEventsEventContent,
},
Expand Down Expand Up @@ -2369,21 +2367,6 @@ mod tests {
Raw::new(&ev_json).unwrap().cast()
}

fn make_member_event(user_id: &UserId, name: &str) -> Raw<SyncRoomMemberEvent> {
let ev_json = json!({
"type": "m.room.member",
"content": assign!(RoomMemberEventContent::new(MembershipState::Join), {
displayname: Some(name.to_owned())
}),
"sender": user_id,
"state_key": user_id,
"event_id": "$h29iv0s1:example.com",
"origin_server_ts": 208,
});

Raw::new(&ev_json).unwrap().cast()
}

#[async_test]
async fn test_display_name_for_joined_room_is_empty_if_no_info() {
let (_, room) = make_room_test_helper(RoomState::Joined);
Expand Down Expand Up @@ -2535,20 +2518,23 @@ mod tests {
let room_id = room_id!("!test:localhost");
let matthew = user_id!("@matthew:example.org");
let me = user_id!("@me:example.org");

let mut changes = StateChanges::new("".to_owned());
let summary = assign!(RumaSummary::new(), {
joined_member_count: Some(2u32.into()),
heroes: vec![me.to_owned(), matthew.to_owned()],
});

let f = EventFactory::new().room(room_id!("!test:localhost"));

let members = changes
.state
.entry(room_id.to_owned())
.or_default()
.entry(StateEventType::RoomMember)
.or_default();
members.insert(matthew.into(), make_member_event(matthew, "Matthew").cast());
members.insert(me.into(), make_member_event(me, "Me").cast());
members.insert(matthew.into(), f.member(matthew).display_name("Matthew").into_raw());
members.insert(me.into(), f.member(me).display_name("Me").into_raw());

store.save_changes(&changes).await.unwrap();

Expand All @@ -2567,14 +2553,16 @@ mod tests {
let me = user_id!("@me:example.org");
let mut changes = StateChanges::new("".to_owned());

let f = EventFactory::new().room(room_id!("!test:localhost"));

let members = changes
.state
.entry(room_id.to_owned())
.or_default()
.entry(StateEventType::RoomMember)
.or_default();
members.insert(matthew.into(), make_member_event(matthew, "Matthew").cast());
members.insert(me.into(), make_member_event(me, "Me").cast());
members.insert(matthew.into(), f.member(matthew).display_name("Matthew").into_raw());
members.insert(me.into(), f.member(me).display_name("Me").into_raw());

store.save_changes(&changes).await.unwrap();

Expand All @@ -2598,6 +2586,8 @@ mod tests {

let mut changes = StateChanges::new("".to_owned());

let f = EventFactory::new().room(room_id!("!test:localhost"));

// Save members in two batches, so that there's no implied ordering in the
// store.
{
Expand All @@ -2607,10 +2597,10 @@ mod tests {
.or_default()
.entry(StateEventType::RoomMember)
.or_default();
members.insert(carol.into(), make_member_event(carol, "Carol").cast());
members.insert(bob.into(), make_member_event(bob, "Bob").cast());
members.insert(fred.into(), make_member_event(fred, "Fred").cast());
members.insert(me.into(), make_member_event(me, "Me").cast());
members.insert(carol.into(), f.member(carol).display_name("Carol").into_raw());
members.insert(bob.into(), f.member(bob).display_name("Bob").into_raw());
members.insert(fred.into(), f.member(fred).display_name("Fred").into_raw());
members.insert(me.into(), f.member(me).display_name("Me").into_raw());
store.save_changes(&changes).await.unwrap();
}

Expand All @@ -2621,9 +2611,9 @@ mod tests {
.or_default()
.entry(StateEventType::RoomMember)
.or_default();
members.insert(alice.into(), make_member_event(alice, "Alice").cast());
members.insert(erica.into(), make_member_event(erica, "Erica").cast());
members.insert(denis.into(), make_member_event(denis, "Denis").cast());
members.insert(alice.into(), f.member(alice).display_name("Alice").into_raw());
members.insert(erica.into(), f.member(erica).display_name("Erica").into_raw());
members.insert(denis.into(), f.member(denis).display_name("Denis").into_raw());
store.save_changes(&changes).await.unwrap();
}

Expand Down Expand Up @@ -2651,6 +2641,8 @@ mod tests {
let fred = user_id!("@fred:example.org");
let me = user_id!("@me:example.org");

let f = EventFactory::new().room(room_id!("!test:localhost"));

let mut changes = StateChanges::new("".to_owned());

// Save members in two batches, so that there's no implied ordering in the
Expand All @@ -2662,10 +2654,11 @@ mod tests {
.or_default()
.entry(StateEventType::RoomMember)
.or_default();
members.insert(carol.into(), make_member_event(carol, "Carol").cast());
members.insert(bob.into(), make_member_event(bob, "Bob").cast());
members.insert(fred.into(), make_member_event(fred, "Fred").cast());
members.insert(me.into(), make_member_event(me, "Me").cast());
members.insert(carol.into(), f.member(carol).display_name("Carol").into_raw());
members.insert(bob.into(), f.member(bob).display_name("Bob").into_raw());
members.insert(fred.into(), f.member(fred).display_name("Fred").into_raw());
members.insert(me.into(), f.member(me).display_name("Me").into_raw());

store.save_changes(&changes).await.unwrap();
}

Expand All @@ -2676,9 +2669,9 @@ mod tests {
.or_default()
.entry(StateEventType::RoomMember)
.or_default();
members.insert(alice.into(), make_member_event(alice, "Alice").cast());
members.insert(erica.into(), make_member_event(erica, "Erica").cast());
members.insert(denis.into(), make_member_event(denis, "Denis").cast());
members.insert(alice.into(), f.member(alice).display_name("Alice").into_raw());
members.insert(erica.into(), f.member(erica).display_name("Erica").into_raw());
members.insert(denis.into(), f.member(denis).display_name("Denis").into_raw());
store.save_changes(&changes).await.unwrap();
}

Expand All @@ -2700,14 +2693,16 @@ mod tests {
heroes: vec![me.to_owned(), matthew.to_owned()],
});

let f = EventFactory::new().room(room_id!("!test:localhost"));

let members = changes
.state
.entry(room_id.to_owned())
.or_default()
.entry(StateEventType::RoomMember)
.or_default();
members.insert(matthew.into(), make_member_event(matthew, "Matthew").cast());
members.insert(me.into(), make_member_event(me, "Me").cast());
members.insert(matthew.into(), f.member(matthew).display_name("Matthew").into_raw());
members.insert(me.into(), f.member(me).display_name("Me").into_raw());

store.save_changes(&changes).await.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-common/src/js_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl<'a> JsFieldVisitor<'a> {
}
}

impl<'a> tracing::field::Visit for JsFieldVisitor<'a> {
impl tracing::field::Visit for JsFieldVisitor<'_> {
fn record_debug(&mut self, field: &Field, value: &dyn Debug) {
if self.result.is_err() {
return;
Expand Down
1 change: 0 additions & 1 deletion crates/matrix-sdk-crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(missing_docs, missing_debug_implementations)]
#![cfg_attr(target_arch = "wasm32", allow(clippy::arc_with_non_send_sync))]
#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation.

pub mod backups;
mod ciphers;
Expand Down
1 change: 0 additions & 1 deletion crates/matrix-sdk-sqlite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
not(any(feature = "state-store", feature = "crypto-store", feature = "event-cache")),
allow(dead_code, unused_imports)
)]
#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation.

#[cfg(feature = "crypto-store")]
mod crypto_store;
Expand Down
2 changes: 0 additions & 2 deletions crates/matrix-sdk-ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation.

use ruma::html::HtmlSanitizerMode;

mod events;
Expand Down
2 changes: 0 additions & 2 deletions crates/matrix-sdk-ui/tests/integration/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(unexpected_cfgs)] // Triggered by the init_tracing_for_tests!() invocation.

use itertools::Itertools as _;
use matrix_sdk::deserialized_responses::TimelineEvent;
use ruma::{events::AnyStateEvent, serde::Raw, EventId, RoomId};
Expand Down
1 change: 1 addition & 0 deletions crates/matrix-sdk/src/client/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ async fn build_indexeddb_store_config(
}

#[cfg(all(not(target_arch = "wasm32"), feature = "indexeddb"))]
#[allow(clippy::unused_async)]
async fn build_indexeddb_store_config(
_name: &str,
_passphrase: Option<&str>,
Expand Down
1 change: 0 additions & 1 deletion crates/matrix-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#![warn(missing_debug_implementations, missing_docs)]
#![cfg_attr(target_arch = "wasm32", allow(clippy::arc_with_non_send_sync))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(test, allow(unexpected_cfgs))] // Triggered by the init_tracing_for_tests!() invocation.

pub use async_trait::async_trait;
pub use bytes;
Expand Down
1 change: 0 additions & 1 deletion crates/matrix-sdk/tests/integration/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// The http mocking library is not supported for wasm32
#![cfg(not(target_arch = "wasm32"))]
#![allow(unexpected_cfgs)] // Triggered by the init_tracing_for_tests!() invocation.
use matrix_sdk::{config::SyncSettings, test_utils::logged_in_client_with_server, Client};
use matrix_sdk_test::test_json;
use serde::Serialize;
Expand Down
1 change: 0 additions & 1 deletion testing/matrix-sdk-integration-testing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(test)]
#![allow(unexpected_cfgs)] // Triggered by the init_tracing_for_tests!() invocation.

matrix_sdk_test::init_tracing_for_tests!();

Expand Down
2 changes: 1 addition & 1 deletion testing/matrix-sdk-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ serde = { workspace = true }
serde_json = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ctor = "0.2.0"
ctor = "0.2.9"
tokio = { workspace = true, features = ["rt", "macros"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
wiremock = { workspace = true }
Expand Down
Loading

0 comments on commit 5173b5a

Please sign in to comment.