From fc817e1132c9464f3b83788e6eff66814ca14ecf Mon Sep 17 00:00:00 2001 From: bitfriend Date: Fri, 30 Aug 2024 00:22:04 +0800 Subject: [PATCH 1/5] Improve code --- app/lib/common/utils/logging.dart | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/lib/common/utils/logging.dart b/app/lib/common/utils/logging.dart index 5d612799e7f0..78c3e351d803 100644 --- a/app/lib/common/utils/logging.dart +++ b/app/lib/common/utils/logging.dart @@ -14,16 +14,13 @@ Future initLogging() async { final message = record.message; debugPrint('[$loggerName][${level.name}]: $time: $message'); - String levelName = 'trace'; - if (level == Level.WARNING) { - levelName = 'warn'; - } else if (level == Level.SEVERE || level == Level.SHOUT) { - levelName = 'error'; - } else if (level == Level.INFO) { - levelName = 'info'; - } else if (level == Level.CONFIG) { - levelName = 'debug'; - } + String levelName = switch (level) { + Level.WARNING => 'warn', + Level.SEVERE || Level.SHOUT => 'error', + Level.INFO => 'info', + Level.CONFIG => 'debug', + _ => 'trace', + }; bool? curVal = logStateCache[(loggerName, levelName)]; if (curVal == null) { From 563a804e3691a2c0bfaf30899fb651c68cf2aba5 Mon Sep 17 00:00:00 2001 From: bitfriend Date: Tue, 18 Feb 2025 16:12:58 +0800 Subject: [PATCH 2/5] Fix long path issue of matrix sdk in windows --- Cargo.lock | 100 +++++++++++++++++++++++++++++------------------------ Cargo.toml | 30 ++++++++-------- 2 files changed, 69 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa82625bd78e..fef7e97573a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -677,15 +677,16 @@ checksum = "a1d084b0137aaa901caf9f1e8b21daa6aa24d41cd806e111335541eff9683bd6" [[package]] name = "blake3" -version = "1.5.5" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" +checksum = "1230237285e3e10cde447185e8975408ae24deaa67205ce684805c25bc0c7937" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", + "memmap2", ] [[package]] @@ -969,9 +970,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.29" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" +checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" dependencies = [ "clap_builder", "clap_derive", @@ -979,9 +980,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.29" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" +checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" dependencies = [ "anstream", "anstyle", @@ -1613,9 +1614,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" @@ -3190,7 +3191,7 @@ dependencies = [ [[package]] name = "matrix-sdk" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "anyhow", "anymap2", @@ -3242,7 +3243,7 @@ dependencies = [ [[package]] name = "matrix-sdk-base" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "as_variant", "async-trait", @@ -3269,7 +3270,7 @@ dependencies = [ [[package]] name = "matrix-sdk-common" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "async-trait", "eyeball-im 0.6.0 (git+https://github.com/jplatte/eyeball?branch=main)", @@ -3292,7 +3293,7 @@ dependencies = [ [[package]] name = "matrix-sdk-crypto" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "aes", "aquamarine", @@ -3332,7 +3333,7 @@ dependencies = [ [[package]] name = "matrix-sdk-indexeddb" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "anyhow", "async-trait", @@ -3360,7 +3361,7 @@ dependencies = [ [[package]] name = "matrix-sdk-sqlite" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "async-trait", "deadpool-sqlite", @@ -3382,7 +3383,7 @@ dependencies = [ [[package]] name = "matrix-sdk-store-encryption" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "base64 0.22.1", "blake3", @@ -3426,7 +3427,7 @@ version = "0.1.3+dev" [[package]] name = "matrix-sdk-test" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "as_variant", "ctor", @@ -3449,7 +3450,7 @@ dependencies = [ [[package]] name = "matrix-sdk-test-macros" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "quote", "syn", @@ -3458,7 +3459,7 @@ dependencies = [ [[package]] name = "matrix-sdk-ui" version = "0.10.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk#f33d10468d3a747d836116e9f54e4561b25be84c" +source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" dependencies = [ "as_variant", "async-once-cell", @@ -3499,6 +3500,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "mime" version = "0.3.17" @@ -3716,9 +3726,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.70" +version = "0.10.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" dependencies = [ "bitflags 2.8.0", "cfg-if", @@ -3757,9 +3767,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.105" +version = "0.9.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" dependencies = [ "cc", "libc", @@ -4250,8 +4260,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.0", - "zerocopy 0.8.17", + "rand_core 0.9.1", + "zerocopy 0.8.18", ] [[package]] @@ -4271,7 +4281,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.0", + "rand_core 0.9.1", ] [[package]] @@ -4285,12 +4295,12 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.17", + "zerocopy 0.8.18", ] [[package]] @@ -5137,9 +5147,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "smawk" @@ -5235,18 +5245,18 @@ dependencies = [ [[package]] name = "strum" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce1475c515a4f03a8a7129bb5228b81a781a86cb0b3fbbc19e1c556d491a401f" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9688894b43459159c82bfa5a5fa0435c19cbe3c9b427fa1dd7b1ce0c279b18a7" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -5321,9 +5331,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.16.0" +version = "3.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" dependencies = [ "cfg-if", "fastrand", @@ -5883,9 +5893,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "typewit" @@ -6273,9 +6283,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced87ca4be083373936a67f8de945faa23b6b42384bd5b64434850802c6dccd0" +checksum = "8c1f41ffb7cf259f1ecc2876861a17e7142e63ead296f671f81f6ae85903e0d6" dependencies = [ "getrandom 0.3.1", "js-sys", @@ -6925,11 +6935,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa91407dacce3a68c56de03abe2760159582b846c6a4acd2f456618087f12713" +checksum = "79386d31a42a4996e3336b0919ddb90f81112af416270cff95b5f5af22b839c2" dependencies = [ - "zerocopy-derive 0.8.17", + "zerocopy-derive 0.8.18", ] [[package]] @@ -6945,9 +6955,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06718a168365cad3d5ff0bb133aad346959a2074bd4a85c121255a11304a8626" +checksum = "76331675d372f91bf8d17e13afbd5fe639200b73d01f0fc748bb059f9cca2db7" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 6184ca8966c6..5661e095b61e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,37 +8,35 @@ members = [ default-members = ["native/acter"] [workspace.dependencies.matrix-sdk] -git = "https://github.com/matrix-org/matrix-rust-sdk" -# path = "../matrix-rust-sdk/crates/matrix-sdk" +git = "https://github.com/acterglobal/matrix-rust-sdk" +rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" default-features = false -features = [ - "rustls-tls", -] - +features = ["rustls-tls"] [workspace.dependencies.matrix-sdk-base] -git = "https://github.com/matrix-org/matrix-rust-sdk" -# path = "../matrix-rust-sdk/crates/matrix-sdk-base" +git = "https://github.com/acterglobal/matrix-rust-sdk" +rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" default-features = false + [workspace.dependencies.matrix-sdk-sqlite] -git = "https://github.com/matrix-org/matrix-rust-sdk" -# path = "../matrix-rust-sdk/crates/matrix-sdk-sqlite" +git = "https://github.com/acterglobal/matrix-rust-sdk" +rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" default-features = false features = ["crypto-store", "state-store"] [workspace.dependencies.matrix-sdk-store-encryption] -git = "https://github.com/matrix-org/matrix-rust-sdk" -# path = "../matrix-rust-sdk/crates/matrix-sdk-store-encryption" +git = "https://github.com/acterglobal/matrix-rust-sdk" +rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" default-features = false [workspace.dependencies.matrix-sdk-ui] -git = "https://github.com/matrix-org/matrix-rust-sdk" -# path = "../matrix-rust-sdk/crates/matrix-sdk-ui" +git = "https://github.com/acterglobal/matrix-rust-sdk" +rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" default-features = false [workspace.dependencies.matrix-sdk-test] -git = "https://github.com/matrix-org/matrix-rust-sdk" -# path = "../matrix-rust-sdk/testing/matrix-sdk-test" +git = "https://github.com/acterglobal/matrix-rust-sdk" +rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" default-features = false From fc52224811b65a83619bf345ed271db2adce248f Mon Sep 17 00:00:00 2001 From: bitfriend Date: Wed, 19 Feb 2025 04:07:49 -0600 Subject: [PATCH 3/5] Fix bug that onTrayMenuItemClick doesn't work in windows --- app/pubspec.lock | 4 ++-- app/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/pubspec.lock b/app/pubspec.lock index 0f8069c03fc2..3e6793868bcf 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -80,10 +80,10 @@ packages: dependency: "direct main" description: name: app_links - sha256: ad1a6d598e7e39b46a34f746f9a8b011ee147e4c275d407fa457e7a62f84dd99 + sha256: "85ed8fc1d25a76475914fff28cc994653bd900bc2c26e4b57a49e097febb54ba" url: "https://pub.dev" source: hosted - version: "6.3.2" + version: "6.4.0" app_links_linux: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 4cabbdeebea5..c93114b18184 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -154,7 +154,7 @@ dependencies: ref: master permission_handler: ^11.3.1 hooks_riverpod: ^2.6.1 - app_links: ^6.3.2 + app_links: ^6.3.3 pretty_qr_code: ^3.3.0 qr_code_dart_scan: ^0.9.3 appcheck: ^1.5.2 From 888982806c467bb2e40338dffc8b1949d6f7c7ce Mon Sep 17 00:00:00 2001 From: bitfriend Date: Wed, 19 Feb 2025 08:10:11 -0600 Subject: [PATCH 4/5] Fix long path issue in windows --- Cargo.lock | 56 +++++++++++++++++++++++------------------------------- Cargo.toml | 36 +++++++++++++++++------------------ 2 files changed, 42 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fef7e97573a1..7dfe0f1b851c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2135,9 +2135,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ "atomic-waker", "bytes", @@ -2371,7 +2371,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.7", + "h2 0.4.8", "http 1.2.0", "http-body 1.0.1", "httparse", @@ -3191,7 +3191,7 @@ dependencies = [ [[package]] name = "matrix-sdk" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "anyhow", "anymap2", @@ -3243,7 +3243,7 @@ dependencies = [ [[package]] name = "matrix-sdk-base" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "as_variant", "async-trait", @@ -3270,7 +3270,7 @@ dependencies = [ [[package]] name = "matrix-sdk-common" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "async-trait", "eyeball-im 0.6.0 (git+https://github.com/jplatte/eyeball?branch=main)", @@ -3293,7 +3293,7 @@ dependencies = [ [[package]] name = "matrix-sdk-crypto" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "aes", "aquamarine", @@ -3333,7 +3333,7 @@ dependencies = [ [[package]] name = "matrix-sdk-indexeddb" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "anyhow", "async-trait", @@ -3361,7 +3361,7 @@ dependencies = [ [[package]] name = "matrix-sdk-sqlite" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "async-trait", "deadpool-sqlite", @@ -3383,7 +3383,7 @@ dependencies = [ [[package]] name = "matrix-sdk-store-encryption" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "base64 0.22.1", "blake3", @@ -3427,7 +3427,7 @@ version = "0.1.3+dev" [[package]] name = "matrix-sdk-test" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "as_variant", "ctor", @@ -3450,7 +3450,7 @@ dependencies = [ [[package]] name = "matrix-sdk-test-macros" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "quote", "syn", @@ -3459,7 +3459,7 @@ dependencies = [ [[package]] name = "matrix-sdk-ui" version = "0.10.0" -source = "git+https://github.com/acterglobal/matrix-rust-sdk?rev=a95632aba2f1c6a0e74c05fd4574b32a6a449fcf#a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=7a06bdb6950f74167e697e795babc8e12e1a5aa3#7a06bdb6950f74167e697e795babc8e12e1a5aa3" dependencies = [ "as_variant", "async-once-cell", @@ -4422,7 +4422,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.7", + "h2 0.4.8", "http 1.2.0", "http-body 1.0.1", "http-body-util", @@ -4541,8 +4541,7 @@ dependencies = [ [[package]] name = "ruma" version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6fea33e3d17b9e009fefb3f175ca7fd40b1e7d1e72444478fd1b28611eb50a" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "assign", "js_int", @@ -4558,8 +4557,7 @@ dependencies = [ [[package]] name = "ruma-client-api" version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23989b539eceeaad01ba089ad307788f90a29bac2e5f730ff0a523eeae3fa1d7" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "as_variant", "assign", @@ -4582,8 +4580,7 @@ dependencies = [ [[package]] name = "ruma-common" version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1058c04b8dd62f4fba71c9f65112fb79bc332438d11aefe1e8edf67b7fb58a98" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "as_variant", "base64 0.22.1", @@ -4615,8 +4612,7 @@ dependencies = [ [[package]] name = "ruma-events" version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1b8e15942e35ba56004429bc0845f481281f903e86957973a08ec08f8d06f0" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "as_variant", "indexmap 2.7.1", @@ -4641,8 +4637,7 @@ dependencies = [ [[package]] name = "ruma-federation-api" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d70c3d37a8e42992aeaa5786cb406ad302bcd05c0e7e3073d5316b4574340dd" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "http 1.2.0", "js_int", @@ -4656,8 +4651,7 @@ dependencies = [ [[package]] name = "ruma-html" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3257ce3398e171ff15245767b1a3d201cfc5cce75f5af7ec7f6b8b5e1d2bdb" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "as_variant", "html5ever", @@ -4669,8 +4663,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-validation" version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad674b5e5368c53a2c90fde7dac7e30747004aaf7b1827b72874a25fc06d4d8" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "js_int", "thiserror 2.0.11", @@ -4679,8 +4672,7 @@ dependencies = [ [[package]] name = "ruma-macros" version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1182e83ee5cd10121974f163337b16af68a93eedfc7cdbdbd52307ac7e1d743" +source = "git+https://github.com/ruma/ruma?rev=7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39#7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" dependencies = [ "cfg-if", "proc-macro-crate", @@ -5936,9 +5928,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-linebreak" diff --git a/Cargo.toml b/Cargo.toml index 5661e095b61e..b9f9bf1ff6af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,50 +8,50 @@ members = [ default-members = ["native/acter"] [workspace.dependencies.matrix-sdk] -git = "https://github.com/acterglobal/matrix-rust-sdk" -rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +git = "https://github.com/matrix-org/matrix-rust-sdk" +rev = "7a06bdb6950f74167e697e795babc8e12e1a5aa3" default-features = false features = ["rustls-tls"] [workspace.dependencies.matrix-sdk-base] -git = "https://github.com/acterglobal/matrix-rust-sdk" -rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +git = "https://github.com/matrix-org/matrix-rust-sdk" +rev = "7a06bdb6950f74167e697e795babc8e12e1a5aa3" default-features = false [workspace.dependencies.matrix-sdk-sqlite] -git = "https://github.com/acterglobal/matrix-rust-sdk" -rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +git = "https://github.com/matrix-org/matrix-rust-sdk" +rev = "7a06bdb6950f74167e697e795babc8e12e1a5aa3" default-features = false features = ["crypto-store", "state-store"] [workspace.dependencies.matrix-sdk-store-encryption] -git = "https://github.com/acterglobal/matrix-rust-sdk" -rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +git = "https://github.com/matrix-org/matrix-rust-sdk" +rev = "7a06bdb6950f74167e697e795babc8e12e1a5aa3" default-features = false [workspace.dependencies.matrix-sdk-ui] -git = "https://github.com/acterglobal/matrix-rust-sdk" -rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +git = "https://github.com/matrix-org/matrix-rust-sdk" +rev = "7a06bdb6950f74167e697e795babc8e12e1a5aa3" default-features = false [workspace.dependencies.matrix-sdk-test] -git = "https://github.com/acterglobal/matrix-rust-sdk" -rev = "a95632aba2f1c6a0e74c05fd4574b32a6a449fcf" +git = "https://github.com/matrix-org/matrix-rust-sdk" +rev = "7a06bdb6950f74167e697e795babc8e12e1a5aa3" default-features = false # not used directly but needed to enable specific features from ruma # ATTENTION: _MUST_ stay in sync with the ruma-rev used by matrix-sdk! [workspace.dependencies.ruma] -version = "0.12.1" -# git = "https://github.com/ruma/ruma" -# rev = "c91499fc464adc865a7c99d0ce0b35982ad96711" +# version = "0.12.1" +git = "https://github.com/ruma/ruma" +rev = "7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" # - see comment above [workspace.dependencies.ruma-common] -version = "0.15.1" -# git = "https://github.com/ruma/ruma" -# rev = "c91499fc464adc865a7c99d0ce0b35982ad96711" +# version = "0.15.1" +git = "https://github.com/ruma/ruma" +rev = "7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39" [workspace.dependencies.url] version = "2.5.0" From 9d62fedf38139a9440cc438c1944005629f9a91f Mon Sep 17 00:00:00 2001 From: bitfriend Date: Wed, 19 Feb 2025 23:52:44 +0800 Subject: [PATCH 5/5] Implement the missing methods in file event cache --- Cargo.lock | 12 ++++----- native/file-event-cache/src/lib.rs | 33 ++++++++++++++++++++--- native/file-event-cache/src/queued.rs | 39 ++++++++++++++++++++++++--- 3 files changed, 72 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dfe0f1b851c..6c8de31af3d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2135,9 +2135,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.8" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -2371,7 +2371,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.8", + "h2 0.4.7", "http 1.2.0", "http-body 1.0.1", "httparse", @@ -4422,7 +4422,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.8", + "h2 0.4.7", "http 1.2.0", "http-body 1.0.1", "http-body-util", @@ -5928,9 +5928,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-linebreak" diff --git a/native/file-event-cache/src/lib.rs b/native/file-event-cache/src/lib.rs index 0d7b51945310..80a42805306f 100644 --- a/native/file-event-cache/src/lib.rs +++ b/native/file-event-cache/src/lib.rs @@ -10,7 +10,7 @@ use matrix_sdk_base::{ }, Event, Gap, }, - linked_chunk::{RawChunk, Update}, + linked_chunk::{ChunkIdentifier, ChunkIdentifierGenerator, RawChunk, Update}, media::{MediaRequestParameters, UniqueKey}, ruma::{MxcUri, RoomId}, StateStore, @@ -109,12 +109,39 @@ where .map_err(|e| e.into()) } - async fn reload_linked_chunk( + async fn load_all_chunks( &self, room_id: &RoomId, ) -> Result>, Self::Error> { self.inner - .reload_linked_chunk(room_id) + .load_all_chunks(room_id) + .await + .map_err(|e| e.into()) + } + + async fn load_last_chunk( + &self, + room_id: &RoomId, + ) -> Result< + ( + Option>, + ChunkIdentifierGenerator, + ), + Self::Error, + > { + self.inner + .load_last_chunk(room_id) + .await + .map_err(|e| e.into()) + } + + async fn load_previous_chunk( + &self, + room_id: &RoomId, + before_chunk_identifier: ChunkIdentifier, + ) -> Result>, Self::Error> { + self.inner + .load_previous_chunk(room_id, before_chunk_identifier) .await .map_err(|e| e.into()) } diff --git a/native/file-event-cache/src/queued.rs b/native/file-event-cache/src/queued.rs index 15d9b54429d3..cea47b8665f1 100644 --- a/native/file-event-cache/src/queued.rs +++ b/native/file-event-cache/src/queued.rs @@ -6,7 +6,7 @@ use matrix_sdk_base::{ store::media::{IgnoreMediaRetentionPolicy, MediaRetentionPolicy}, Event, Gap, }, - linked_chunk::{RawChunk, Update}, + linked_chunk::{ChunkIdentifier, ChunkIdentifierGenerator, RawChunk, Update}, media::MediaRequestParameters, ruma::{MxcUri, RoomId}, }; @@ -73,7 +73,7 @@ where .await } - async fn reload_linked_chunk( + async fn load_all_chunks( &self, room_id: &RoomId, ) -> Result>, Self::Error> { @@ -82,7 +82,40 @@ where .acquire() .await .expect("We never close the semaphore"); - self.inner.reload_linked_chunk(room_id).await + self.inner.load_all_chunks(room_id).await + } + + async fn load_last_chunk( + &self, + room_id: &RoomId, + ) -> Result< + ( + Option>, + ChunkIdentifierGenerator, + ), + Self::Error, + > { + let _handle = self + .queue + .acquire() + .await + .expect("We never close the semaphore"); + self.inner.load_last_chunk(room_id).await + } + + async fn load_previous_chunk( + &self, + room_id: &RoomId, + before_chunk_identifier: ChunkIdentifier, + ) -> Result>, Self::Error> { + let _handle = self + .queue + .acquire() + .await + .expect("We never close the semaphore"); + self.inner + .load_previous_chunk(room_id, before_chunk_identifier) + .await } #[instrument(skip_all)]