From 1dbd2caeb229f600cb7043f67cd0325b391a813b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Fri, 20 Feb 2026 15:20:03 +0100 Subject: [PATCH] testing: Remove once_cell dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the types that were stabilized in the standard library instead. Signed-off-by: Kévin Commaille --- Cargo.lock | 2 - .../matrix-sdk-integration-testing/Cargo.toml | 1 - .../src/helpers.rs | 5 +-- .../src/tests/sliding_sync/room.rs | 3 +- testing/matrix-sdk-test/Cargo.toml | 1 - testing/matrix-sdk-test/src/lib.rs | 13 +++--- .../src/test_json/api_responses.rs | 45 ++++++++++--------- .../matrix-sdk-test/src/test_json/members.rs | 5 ++- testing/matrix-sdk-test/src/test_json/mod.rs | 9 ++-- .../src/test_json/search_users.rs | 7 +-- testing/matrix-sdk-test/src/test_json/sync.rs | 37 +++++++-------- 11 files changed, 63 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bd43b0f8..736b18619 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3415,7 +3415,6 @@ dependencies = [ "matrix-sdk-test", "matrix-sdk-test-utils", "matrix-sdk-ui", - "once_cell", "rand 0.8.5", "reqwest", "serde_json", @@ -3525,7 +3524,6 @@ dependencies = [ "insta", "matrix-sdk-common", "matrix-sdk-test-macros", - "once_cell", "ruma", "serde", "serde_json", diff --git a/testing/matrix-sdk-integration-testing/Cargo.toml b/testing/matrix-sdk-integration-testing/Cargo.toml index 9d8e7d542..2fd829366 100644 --- a/testing/matrix-sdk-integration-testing/Cargo.toml +++ b/testing/matrix-sdk-integration-testing/Cargo.toml @@ -37,7 +37,6 @@ matrix-sdk-common.workspace = true matrix-sdk-test.workspace = true matrix-sdk-test-utils.workspace = true matrix-sdk-ui = { workspace = true, default-features = true } -once_cell.workspace = true rand.workspace = true reqwest.workspace = true serde_json.workspace = true diff --git a/testing/matrix-sdk-integration-testing/src/helpers.rs b/testing/matrix-sdk-integration-testing/src/helpers.rs index 4a2177555..0b6b2829d 100644 --- a/testing/matrix-sdk-integration-testing/src/helpers.rs +++ b/testing/matrix-sdk-integration-testing/src/helpers.rs @@ -3,7 +3,7 @@ use std::{ ops::Deref, option_env, path::{Path, PathBuf}, - sync::{Arc, Mutex as StdMutex}, + sync::{Arc, LazyLock, Mutex as StdMutex}, time::Duration, }; @@ -24,14 +24,13 @@ use matrix_sdk::{ }; use matrix_sdk_base::crypto::{CollectStrategy, DecryptionSettings, TrustRequirement}; use matrix_sdk_common::cross_process_lock::CrossProcessLockConfig; -use once_cell::sync::Lazy; use rand::Rng as _; use tempfile::{TempDir, tempdir}; use tokio::{sync::Mutex, time::sleep}; /// This global maintains temp directories alive for the whole lifetime of the /// process. -static TMP_DIRS: Lazy>> = Lazy::new(Mutex::default); +static TMP_DIRS: LazyLock>> = LazyLock::new(Mutex::default); enum SqlitePath { Random, diff --git a/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs b/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs index 4321fe4db..1879a04b3 100644 --- a/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs +++ b/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs @@ -3,7 +3,7 @@ use std::{ collections::BTreeMap, - sync::{Arc, Mutex as StdMutex}, + sync::{Arc, LazyLock, Mutex as StdMutex}, time::Duration, }; @@ -49,7 +49,6 @@ use matrix_sdk_ui::{ RoomListService, room_list_service::filters::new_filter_all, sync_service::SyncService, timeline::RoomExt, }; -use once_cell::sync::Lazy; use rand::Rng as _; use serde_json::Value; use stream_assert::assert_pending; diff --git a/testing/matrix-sdk-test/Cargo.toml b/testing/matrix-sdk-test/Cargo.toml index e5c3d0860..910f2806c 100644 --- a/testing/matrix-sdk-test/Cargo.toml +++ b/testing/matrix-sdk-test/Cargo.toml @@ -27,7 +27,6 @@ http.workspace = true insta.workspace = true matrix-sdk-common = { version = "0.16.0", path = "../../crates/matrix-sdk-common" } matrix-sdk-test-macros = { version = "0.16.0", path = "../matrix-sdk-test-macros" } -once_cell.workspace = true # Enable the unstable feature for polls support. # "client-api-s" enables need the "server" feature of ruma-client-api, which is needed to serialize Response objects to JSON. ruma = { workspace = true, features = ["client-api-s", "rand", "unstable-msc3381", "unstable-msc4274"] } diff --git a/testing/matrix-sdk-test/src/lib.rs b/testing/matrix-sdk-test/src/lib.rs index 536404537..0554c68c4 100644 --- a/testing/matrix-sdk-test/src/lib.rs +++ b/testing/matrix-sdk-test/src/lib.rs @@ -1,8 +1,7 @@ -use std::fmt; +use std::{fmt, sync::LazyLock}; use http::Response; pub use matrix_sdk_test_macros::async_test; -use once_cell::sync::Lazy; use ruma::{ RoomId, UserId, api::{IncomingResponse, OutgoingResponse}, @@ -82,13 +81,13 @@ pub use self::sync_builder::{ SyncResponseBuilder, bulk_room_members, }; -pub static ALICE: Lazy<&UserId> = Lazy::new(|| user_id!("@alice:server.name")); -pub static BOB: Lazy<&UserId> = Lazy::new(|| user_id!("@bob:other.server")); -pub static CAROL: Lazy<&UserId> = Lazy::new(|| user_id!("@carol:other.server")); +pub static ALICE: LazyLock<&UserId> = LazyLock::new(|| user_id!("@alice:server.name")); +pub static BOB: LazyLock<&UserId> = LazyLock::new(|| user_id!("@bob:other.server")); +pub static CAROL: LazyLock<&UserId> = LazyLock::new(|| user_id!("@carol:other.server")); /// The default room ID for tests. -pub static DEFAULT_TEST_ROOM_ID: Lazy<&RoomId> = - Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgC:localhost")); +pub static DEFAULT_TEST_ROOM_ID: LazyLock<&RoomId> = + LazyLock::new(|| room_id!("!SVkFJHzfwvuaIEawgC:localhost")); /// Build a typed Ruma [`IncomingResponse`] object from a json body. pub fn ruma_response_from_json( diff --git a/testing/matrix-sdk-test/src/test_json/api_responses.rs b/testing/matrix-sdk-test/src/test_json/api_responses.rs index 0dc2429d2..db76748b1 100644 --- a/testing/matrix-sdk-test/src/test_json/api_responses.rs +++ b/testing/matrix-sdk-test/src/test_json/api_responses.rs @@ -1,10 +1,11 @@ //! Responses to client API calls. -use once_cell::sync::Lazy; +use std::sync::LazyLock; + use serde_json::{Value as JsonValue, json}; /// `GET /_matrix/client/v3/devices` -pub static DEVICES: Lazy = Lazy::new(|| { +pub static DEVICES: LazyLock = LazyLock::new(|| { json!({ "devices": [ { @@ -26,7 +27,7 @@ pub static DEVICES: Lazy = Lazy::new(|| { }); /// `GET /_matrix/client/v3/device/{deviceId}` -pub static DEVICE: Lazy = Lazy::new(|| { +pub static DEVICE: LazyLock = LazyLock::new(|| { json!({ "device_id": "QBUAZIFURK", "display_name": "android", @@ -36,7 +37,7 @@ pub static DEVICE: Lazy = Lazy::new(|| { }); /// `GET /_matrix/client/v3/directory/room/{roomAlias}` -pub static GET_ALIAS: Lazy = Lazy::new(|| { +pub static GET_ALIAS: LazyLock = LazyLock::new(|| { json!({ "room_id": "!lUbmUPdxdXxEQurqOs:example.net", "servers": [ @@ -48,7 +49,7 @@ pub static GET_ALIAS: Lazy = Lazy::new(|| { }); /// `POST /_matrix/client/v3/keys/query` -pub static KEYS_QUERY: Lazy = Lazy::new(|| { +pub static KEYS_QUERY: LazyLock = LazyLock::new(|| { json!({ "device_keys": { "@alice:example.org": { @@ -81,7 +82,7 @@ pub static KEYS_QUERY: Lazy = Lazy::new(|| { /// `POST /_matrix/client/v3/keys/query` /// For a set of 2 devices own by a user named web2. /// First device is unsigned, second one is signed -pub static KEYS_QUERY_TWO_DEVICES_ONE_SIGNED: Lazy = Lazy::new(|| { +pub static KEYS_QUERY_TWO_DEVICES_ONE_SIGNED: LazyLock = LazyLock::new(|| { json!({ "device_keys":{ "@web2:localhost:8482":{ @@ -164,7 +165,7 @@ pub static KEYS_QUERY_TWO_DEVICES_ONE_SIGNED: Lazy = Lazy::new(|| { }); /// `` -pub static KEYS_UPLOAD: Lazy = Lazy::new(|| { +pub static KEYS_UPLOAD: LazyLock = LazyLock::new(|| { json!({ "one_time_key_counts": { "curve25519": 10, @@ -174,7 +175,7 @@ pub static KEYS_UPLOAD: Lazy = Lazy::new(|| { }); /// Successful call to `POST /_matrix/client/v3/login` without auto-discovery. -pub static LOGIN: Lazy = Lazy::new(|| { +pub static LOGIN: LazyLock = LazyLock::new(|| { json!({ "access_token": "abc123", "device_id": "GHTYAJCE", @@ -184,7 +185,7 @@ pub static LOGIN: Lazy = Lazy::new(|| { }); /// Successful call to `POST /_matrix/client/v3/login` with auto-discovery. -pub static LOGIN_WITH_DISCOVERY: Lazy = Lazy::new(|| { +pub static LOGIN_WITH_DISCOVERY: LazyLock = LazyLock::new(|| { json!({ "access_token": "abc123", "device_id": "GHTYAJCE", @@ -202,7 +203,7 @@ pub static LOGIN_WITH_DISCOVERY: Lazy = Lazy::new(|| { }); /// Successful call to `POST /_matrix/client/v3/login` with a refresh token. -pub static LOGIN_WITH_REFRESH_TOKEN: Lazy = Lazy::new(|| { +pub static LOGIN_WITH_REFRESH_TOKEN: LazyLock = LazyLock::new(|| { json!({ "access_token": "abc123", "device_id": "GHTYAJCE", @@ -214,7 +215,7 @@ pub static LOGIN_WITH_REFRESH_TOKEN: Lazy = Lazy::new(|| { }); /// Failed call to `POST /_matrix/client/v3/login` -pub static LOGIN_RESPONSE_ERR: Lazy = Lazy::new(|| { +pub static LOGIN_RESPONSE_ERR: LazyLock = LazyLock::new(|| { json!({ "errcode": "M_FORBIDDEN", "error": "Invalid password" @@ -222,7 +223,7 @@ pub static LOGIN_RESPONSE_ERR: Lazy = Lazy::new(|| { }); /// `GET /_matrix/client/v3/login` -pub static LOGIN_TYPES: Lazy = Lazy::new(|| { +pub static LOGIN_TYPES: LazyLock = LazyLock::new(|| { json!({ "flows": [ { @@ -240,7 +241,7 @@ pub static LOGIN_TYPES: Lazy = Lazy::new(|| { /// Failed call to an endpoint when the resource that was asked could not be /// found. -pub static NOT_FOUND: Lazy = Lazy::new(|| { +pub static NOT_FOUND: LazyLock = LazyLock::new(|| { json!({ "errcode": "M_NOT_FOUND", "error": "No resource was found for this request.", @@ -250,7 +251,7 @@ pub static NOT_FOUND: Lazy = Lazy::new(|| { /// `GET /_matrix/client/v3/publicRooms` /// `POST /_matrix/client/v3/publicRooms` -pub static PUBLIC_ROOMS: Lazy = Lazy::new(|| { +pub static PUBLIC_ROOMS: LazyLock = LazyLock::new(|| { json!({ "chunk": [ { @@ -274,7 +275,7 @@ pub static PUBLIC_ROOMS: Lazy = Lazy::new(|| { /// `GET /_matrix/client/v3/publicRooms` /// `POST /_matrix/client/v3/publicRooms`` -pub static PUBLIC_ROOMS_FINAL_PAGE: Lazy = Lazy::new(|| { +pub static PUBLIC_ROOMS_FINAL_PAGE: LazyLock = LazyLock::new(|| { json!({ "chunk": [ { @@ -295,7 +296,7 @@ pub static PUBLIC_ROOMS_FINAL_PAGE: Lazy = Lazy::new(|| { }); /// `POST /_matrix/client/v3/refresh` without new refresh token. -pub static REFRESH_TOKEN: Lazy = Lazy::new(|| { +pub static REFRESH_TOKEN: LazyLock = LazyLock::new(|| { json!({ "access_token": "5678", "expire_in_ms": 432000000, @@ -303,7 +304,7 @@ pub static REFRESH_TOKEN: Lazy = Lazy::new(|| { }); /// `POST /_matrix/client/v3/refresh` with a new refresh token. -pub static REFRESH_TOKEN_WITH_REFRESH_TOKEN: Lazy = Lazy::new(|| { +pub static REFRESH_TOKEN_WITH_REFRESH_TOKEN: LazyLock = LazyLock::new(|| { json!({ "access_token": "9012", "expire_in_ms": 432000000, @@ -312,7 +313,7 @@ pub static REFRESH_TOKEN_WITH_REFRESH_TOKEN: Lazy = Lazy::new(|| { }); /// Failed call to `POST /_matrix/client/v3/register` -pub static REGISTRATION_RESPONSE_ERR: Lazy = Lazy::new(|| { +pub static REGISTRATION_RESPONSE_ERR: LazyLock = LazyLock::new(|| { json!({ "errcode": "M_FORBIDDEN", "error": "Invalid password", @@ -335,7 +336,7 @@ pub static REGISTRATION_RESPONSE_ERR: Lazy = Lazy::new(|| { }); /// Failed called to any endpoint with an expired access token. -pub static UNKNOWN_TOKEN_SOFT_LOGOUT: Lazy = Lazy::new(|| { +pub static UNKNOWN_TOKEN_SOFT_LOGOUT: LazyLock = LazyLock::new(|| { json!({ "errcode": "M_UNKNOWN_TOKEN", "error": "Invalid access token passed.", @@ -344,7 +345,7 @@ pub static UNKNOWN_TOKEN_SOFT_LOGOUT: Lazy = Lazy::new(|| { }); /// `GET /_matrix/client/versions` -pub static VERSIONS: Lazy = Lazy::new(|| { +pub static VERSIONS: LazyLock = LazyLock::new(|| { json!({ "versions": [ "r0.0.1", @@ -365,7 +366,7 @@ pub static VERSIONS: Lazy = Lazy::new(|| { }); /// `GET /.well-known/matrix/client` -pub static WELL_KNOWN: Lazy = Lazy::new(|| { +pub static WELL_KNOWN: LazyLock = LazyLock::new(|| { json!({ "m.homeserver": { "base_url": "HOMESERVER_URL" @@ -380,7 +381,7 @@ pub static WELL_KNOWN: Lazy = Lazy::new(|| { }); /// `GET /_matrix/client/v3/account/whoami` -pub static WHOAMI: Lazy = Lazy::new(|| { +pub static WHOAMI: LazyLock = LazyLock::new(|| { json!({ "user_id": "@joe:example.org" }) diff --git a/testing/matrix-sdk-test/src/test_json/members.rs b/testing/matrix-sdk-test/src/test_json/members.rs index c4915e40f..8b24f52a0 100644 --- a/testing/matrix-sdk-test/src/test_json/members.rs +++ b/testing/matrix-sdk-test/src/test_json/members.rs @@ -1,11 +1,12 @@ //! Example responses to `GET /_matrix/client/v3/rooms/{roomId}/members` -use once_cell::sync::Lazy; +use std::sync::LazyLock; + use serde_json::{Value as JsonValue, json}; use super::DEFAULT_TEST_ROOM_ID; -pub static MEMBERS: Lazy = Lazy::new(|| { +pub static MEMBERS: LazyLock = LazyLock::new(|| { json!({ "chunk": [ { diff --git a/testing/matrix-sdk-test/src/test_json/mod.rs b/testing/matrix-sdk-test/src/test_json/mod.rs index 2c62f3112..ab8966627 100644 --- a/testing/matrix-sdk-test/src/test_json/mod.rs +++ b/testing/matrix-sdk-test/src/test_json/mod.rs @@ -4,7 +4,8 @@ //! truth. When running `cargo publish` no external folders are allowed so all //! the test data needs to be contained within this crate. -use once_cell::sync::Lazy; +use std::sync::LazyLock; + use serde_json::{Value as JsonValue, json}; use crate::DEFAULT_TEST_ROOM_ID; @@ -28,17 +29,17 @@ pub use sync::{ }; /// An empty response. -pub static EMPTY: Lazy = Lazy::new(|| json!({})); +pub static EMPTY: LazyLock = LazyLock::new(|| json!({})); /// A response with only an event ID. -pub static EVENT_ID: Lazy = Lazy::new(|| { +pub static EVENT_ID: LazyLock = LazyLock::new(|| { json!({ "event_id": "$h29iv0s8:example.com" }) }); /// A response with only a room ID. -pub static ROOM_ID: Lazy = Lazy::new(|| { +pub static ROOM_ID: LazyLock = LazyLock::new(|| { json!({ "room_id": *DEFAULT_TEST_ROOM_ID }) diff --git a/testing/matrix-sdk-test/src/test_json/search_users.rs b/testing/matrix-sdk-test/src/test_json/search_users.rs index 3ab9c96a2..7ef113ba8 100644 --- a/testing/matrix-sdk-test/src/test_json/search_users.rs +++ b/testing/matrix-sdk-test/src/test_json/search_users.rs @@ -1,14 +1,15 @@ -use once_cell::sync::Lazy; +use std::sync::LazyLock; + use serde_json::{Value as JsonValue, json}; -pub static SEARCH_USERS_REQUEST: Lazy = Lazy::new(|| { +pub static SEARCH_USERS_REQUEST: LazyLock = LazyLock::new(|| { json!({ "search_term": "test", "limit": 50 }) }); -pub static SEARCH_USERS_RESPONSE: Lazy = Lazy::new(|| { +pub static SEARCH_USERS_RESPONSE: LazyLock = LazyLock::new(|| { json!({ "limited": false, "results": [ diff --git a/testing/matrix-sdk-test/src/test_json/sync.rs b/testing/matrix-sdk-test/src/test_json/sync.rs index 014a855c3..d347ea77a 100644 --- a/testing/matrix-sdk-test/src/test_json/sync.rs +++ b/testing/matrix-sdk-test/src/test_json/sync.rs @@ -1,12 +1,13 @@ //! Complete sync responses. -use once_cell::sync::Lazy; +use std::sync::LazyLock; + use ruma::{RoomId, room_id}; use serde_json::{Value as JsonValue, json}; use crate::DEFAULT_TEST_ROOM_ID; -pub static SYNC: Lazy = Lazy::new(|| { +pub static SYNC: LazyLock = LazyLock::new(|| { json!({ "device_one_time_keys_count": {}, "next_batch": "s526_47314_0_7_1_1_1_11444_1", @@ -267,7 +268,7 @@ pub static SYNC: Lazy = Lazy::new(|| { }) }); -pub static DEFAULT_SYNC_SUMMARY: Lazy = Lazy::new(|| { +pub static DEFAULT_SYNC_SUMMARY: LazyLock = LazyLock::new(|| { json!({ "device_one_time_keys_count": {}, "next_batch": "s526_47314_0_7_1_1_1_11444_1", @@ -525,7 +526,7 @@ pub static DEFAULT_SYNC_SUMMARY: Lazy = Lazy::new(|| { }) }); -pub static INVITE_SYNC: Lazy = Lazy::new(|| { +pub static INVITE_SYNC: LazyLock = LazyLock::new(|| { json!({ "device_one_time_keys_count": {}, "next_batch": "s526_47314_0_7_1_1_1_11444_2", @@ -584,7 +585,7 @@ pub static INVITE_SYNC: Lazy = Lazy::new(|| { }) }); -pub static LEAVE_SYNC: Lazy = Lazy::new(|| { +pub static LEAVE_SYNC: LazyLock = LazyLock::new(|| { json!({ "device_one_time_keys_count": {}, "next_batch": "s526_47314_0_7_1_1_1_11444_1", @@ -867,7 +868,7 @@ pub static LEAVE_SYNC: Lazy = Lazy::new(|| { }) }); -pub static LEAVE_SYNC_EVENT: Lazy = Lazy::new(|| { +pub static LEAVE_SYNC_EVENT: LazyLock = LazyLock::new(|| { json!({ "account_data": { "events": [] @@ -934,7 +935,7 @@ pub static LEAVE_SYNC_EVENT: Lazy = Lazy::new(|| { }) }); -pub static JOIN_SPACE_SYNC: Lazy = Lazy::new(|| { +pub static JOIN_SPACE_SYNC: LazyLock = LazyLock::new(|| { json!({ "device_one_time_keys_count": {}, "next_batch": "s526_47314_0_7_1_1_1_11444_1", @@ -1197,20 +1198,20 @@ pub static JOIN_SPACE_SYNC: Lazy = Lazy::new(|| { }); /// In the [`MIXED_SYNC`], the room id of the joined room. -pub static MIXED_JOINED_ROOM_ID: Lazy<&RoomId> = - Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgC:localhost")); +pub static MIXED_JOINED_ROOM_ID: LazyLock<&RoomId> = + LazyLock::new(|| room_id!("!SVkFJHzfwvuaIEawgC:localhost")); /// In the [`MIXED_SYNC`], the room id of the left room. -pub static MIXED_LEFT_ROOM_ID: Lazy<&RoomId> = - Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgD:localhost")); +pub static MIXED_LEFT_ROOM_ID: LazyLock<&RoomId> = + LazyLock::new(|| room_id!("!SVkFJHzfwvuaIEawgD:localhost")); /// In the [`MIXED_SYNC`], the room id of the invited room. -pub static MIXED_INVITED_ROOM_ID: Lazy<&RoomId> = - Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgE:localhost")); +pub static MIXED_INVITED_ROOM_ID: LazyLock<&RoomId> = + LazyLock::new(|| room_id!("!SVkFJHzfwvuaIEawgE:localhost")); /// In the [`MIXED_SYNC`], the room id of the knocked room. -pub static MIXED_KNOCKED_ROOM_ID: Lazy<&RoomId> = - Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgF:localhost")); +pub static MIXED_KNOCKED_ROOM_ID: LazyLock<&RoomId> = + LazyLock::new(|| room_id!("!SVkFJHzfwvuaIEawgF:localhost")); /// A sync that contains updates to joined/invited/knocked/left rooms. -pub static MIXED_SYNC: Lazy = Lazy::new(|| { +pub static MIXED_SYNC: LazyLock = LazyLock::new(|| { json!({ "account_data": { "events": [] @@ -1398,7 +1399,7 @@ pub static MIXED_SYNC: Lazy = Lazy::new(|| { }) }); -pub static SYNC_ADMIN_AND_MOD: Lazy = Lazy::new(|| { +pub static SYNC_ADMIN_AND_MOD: LazyLock = LazyLock::new(|| { json!({ "device_one_time_keys_count": {}, "next_batch": "s526_47314_0_7_1_1_1_11444_1", @@ -1587,7 +1588,7 @@ pub static SYNC_ADMIN_AND_MOD: Lazy = Lazy::new(|| { }) }); -pub static CUSTOM_ROOM_POWER_LEVELS: Lazy = Lazy::new(|| { +pub static CUSTOM_ROOM_POWER_LEVELS: LazyLock = LazyLock::new(|| { json!({ "device_one_time_keys_count": {}, "next_batch": "s526_47314_0_7_1_1_1_11444_1",