Commit Graph

11053 Commits

Author SHA1 Message Date
Kévin Commaille
ca392b08c9 chore: Add changelog for UserSession deserialization
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-02-18 11:32:44 +01:00
Kévin Commaille
e9a34f6359 refactor(oidc): Remove support for deserializing previous UserSession format
The format changed 10 months ago and since it contains the tokens, it should have be reserialized already in that time.

Afaict EX clients do not serialize that type, the bindings have their own `Session` type for that.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-02-18 11:32:44 +01:00
dependabot[bot]
6411d27096 chore(deps): bump crate-ci/typos from 1.29.5 to 1.29.7
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.29.5 to 1.29.7.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.29.5...v1.29.7)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 16:47:15 +01:00
Ivan Enderlin
07f0017d30 feat(common): Introduce Chunk::lazy_previous in the LinkedChunk.
This patch introduces `Chunk::lazy_previous` which is a key feature to
support lazy-loading of a `LinkedChunk`. When a chunk is loaded, if it
is the first, it keeps in memory whether it has a previous chunk or not.
Thus, it is possible to insert new chunk in front of the `LinkedChunk`,
and `Update`s will correctly continue to link chunks between them (with
`NewItemsChunk` and `NewGapChunk`).

Example, imagine the following chunks: [0] <-> [1] <-> [2]. If [2] is
the only one being loaded. Then its previous chunk, [1], is loaded from
the store (because [2]'s previous is [1] in the store). Then [1] is
replaced by [3] and [4]. We get this: [4] <-> [3] <-> [1] <-> [2]. If
the `Update::New*Chunk` for [4] doesn't contain a `previous`, the store
is out of sync: in the store, [4] has no previous, but [0] still has [1]
for its `next`.

With this `lazy_previous`, the links are correctly computed.
2025-02-17 14:09:17 +01:00
Benjamin Bouvier
59f9d12da5 perf(timeline): make replacing replies much faster by indexing replies 2025-02-17 12:24:19 +01:00
Kévin Commaille
1c114978e4 refactor(oidc): Remove method to authorize arbitrary scope
Only the scopes necessary during login are specified in MSC2967 now.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-02-17 12:02:43 +01:00
Stefan Ceriu
629421214f change(crypto): have the RoomIdentityProvider return processing changes when identities transition to IdentityState::Verified too (#4670)
While implementing user verification on Element X I realized that the
`IdentityStatusChanges` stream does not notify us when an user becomes
`Verified`, which is a shame as it's perfect for powering app updates
after verifying users (i.e. all the decorations we show throughout the
app: room header, room details, room member list, room member profile
etc.)

Had a look at the existing code and, while that seems completely
intentional, there is no reason why we can't expand its purview.
2025-02-17 11:48:35 +02:00
Jorge Martín
97d772dd05 test: reverse the logic behind test_focused_timeline_reacts so it checks no reactions are received 2025-02-17 09:47:23 +01:00
Jorge Martín
f28c64ba21 test: modify pinned event tests to make sure we don't add events from paginations or syncs to the timeline 2025-02-17 09:47:23 +01:00
Jorge Martín
20dd15e256 fix(timeline): Don't add events to the pinned events timeline when we receive them on paginations/syncs 2025-02-17 09:47:23 +01:00
Ivan Enderlin
f33d10468d refactor(base): Remove the sliding_sync::http re-export.
This patch removes the `pub use ruma::api::client::sync::sync_events::v5
as http` re-export in `matrix_sdk_base::sliding_sync`.
2025-02-14 14:00:39 +01:00
Ivan Enderlin
d3b3b4db10 chore(base): Remove the sliding_sync module.
This patch inlines `sliding_sync::http` inside `sliding_sync`. Then, the
`sliding_sync/mod.rs` file is renamed to `sliding_sync.rs`.
2025-02-14 14:00:39 +01:00
Ivan Enderlin
38e28643f1 fix: Remove support for MSC3575. 2025-02-14 14:00:39 +01:00
Valere
9de6d28270 logging(crypto): Add more logs when identity or devices change 2025-02-14 10:43:42 +01:00
Benjamin Bouvier
9f47201bab bench: add a profiling profile that doesn't enable LTO for quick rebuilds 2025-02-14 09:02:38 +01:00
Benjamin Bouvier
0b7140c123 bench: add a benchmark to measure how long it takes to fill a timeline with lots of initial items 2025-02-14 09:02:38 +01:00
Damir Jelić
28a4918ff6 chore(test): Increase the timeout for the sync service offline mode test 2025-02-13 17:00:42 +01:00
Benjamin Bouvier
534cd599f4 doc: remove internal links to macro
Those worked fine until now, but it seems they started to fail after
including the `testing` feature in the benchmark repository. Oh well.
2025-02-13 16:02:10 +01:00
Benjamin Bouvier
910a5ce90a ci: add a task to compile benchmarks
This adds a task to compile the benchmarks in CI, without running them,
and with the lowest level of optimization that's available (the `dev`
profile).
2025-02-13 16:02:10 +01:00
Benjamin Bouvier
dadd01a4ea chore: fix benchmarks and use the MatrixMockServer in there too 2025-02-13 16:02:10 +01:00
Damir Jelić
c4a9059814 Merge branch 'oidc_e2e' 2025-02-13 15:59:20 +01:00
Damir Jelić
51a1cd3c67 Merge pull request #4604 from zecakeh/qr-login-oauth2
refactor(auth-qrcode): Use oauth2 crate instead of openidconnect
2025-02-13 15:42:51 +01:00
Kévin Commaille
c6d2ab4637 chore: Fix changelog location
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-02-13 15:26:11 +01:00
Kévin Commaille
c6c7307d6e Merge branch 'main' into qr-login-oauth2 2025-02-13 15:20:10 +01:00
Kévin Commaille
9c9944aa0c chore: Update changelog for TLS 1.2
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-02-13 14:21:25 +01:00
Kévin Commaille
b311197d41 feat(sdk): Only allow TLS 1.2 or newer
As recommended by BCP 195.

It shouldn't be a problem with rustls that only supports TLS 1.2 and 1.3, but with native-tls it depends on the implementation.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-02-13 14:21:25 +01:00
Benjamin Bouvier
1068d88c3e fix(event cache store): shortcut when there's no duplicate events to check at all
Otherwise this causes a panic when repeating the events variable, when
generating the SQL query below.
2025-02-13 13:43:49 +01:00
Damir Jelić
861078a95e feat: Add a memoized variant of Oidc::fetch_account_management_url 2025-02-13 12:32:42 +01:00
Damir Jelić
aa9aef44f7 refactor: Rename Oidc::account_management_url to fetch_account_management_url 2025-02-13 12:32:42 +01:00
Damir Jelić
f2ad11a56a refactor(client): Create a common struct for client caches 2025-02-13 12:32:42 +01:00
Damir Jelić
12c327292f feat(common): Add a simple TTL cache implementation 2025-02-13 12:32:42 +01:00
Kévin Commaille
31e78c2a1b refactor(oidc): Only support public clients (#4634)
This should be the most common case, and is already the only case
supported by the higher level APIs like `url_for_oidc` and
`login_with_qr_code`. It simplifies the API because we can call
`restore_registered_client` directly from `register_client`, which was a
TODO.

- [x] Public API changes documented in changelogs (optional)

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-02-13 11:40:17 +01:00
Benjamin Bouvier
8a64922130 test(event cache): address review comments and add a test for storage deduplication 2025-02-13 10:53:20 +01:00
Benjamin Bouvier
2ae142f257 refactor(event cache): get rid of a few generics
The YAGNI crew strikes again.
2025-02-13 10:53:20 +01:00
Benjamin Bouvier
faa0e6e554 feat(event cache): allow using the bloom filter OR the store to deduplicate events 2025-02-13 10:53:20 +01:00
Benjamin Bouvier
b95cf79a6d refactor(event cache): move the gist of deduplication into BloomFilterDeduplicator 2025-02-13 10:53:20 +01:00
Benjamin Bouvier
28cd8beb77 refactor(event cache): rename Deduplicator to BloomFilterDeduplicator 2025-02-13 10:53:20 +01:00
Ivan Enderlin
1918bd5f6b chore(base): Rename variables. 2025-02-12 16:50:14 +01:00
Ivan Enderlin
d45addee10 feat(base): Add EventCacheStore::filter_duplicated_events.
This patch adds and implements the
`EventCacheStore::filter_duplicated_events` method. It is implemented on
the `MemoryStore` and the `SqliteEventCacheStore`.

This method remove the unique events and reutrn the duplicated events.
2025-02-12 16:50:14 +01:00
Ivan Enderlin
ed16e91aed fix: RoomEventCache::subscribe is now infallible.
This patch updates `RoomEventCache::subscribe` to be infallible. This
method wasn't able to return something else than an `Ok`. The return
type has been updated from `Result<T>` to `T`.
2025-02-12 16:35:03 +01:00
Ivan Enderlin
714caae545 chore(sqlite): Remove a useless indentation.
This patch removes a useless indentation.
2025-02-12 16:13:40 +01:00
Andy Balaam
25bb607b27 feat(crypto): Allow fetching encryption info using session ID 2025-02-12 14:00:14 +00:00
Andy Balaam
c9a6ae9549 fix(tests): Prevent test flake by using different names for the test stores 2025-02-12 13:45:20 +00:00
Benjamin Bouvier
58099fd6b5 test(timeline): add new tests for fetching replies that are UTD or sticker or polls 2025-02-12 14:28:17 +01:00
Benjamin Bouvier
c5856a33f0 test(timeline): rewrite and comment fetch_details() test 2025-02-12 14:28:17 +01:00
Benjamin Bouvier
a5f115f21f test(timeline): use the MatrixMockServer in integration/timeline/replies 2025-02-12 14:28:17 +01:00
Benjamin Bouvier
ddd84e231b feat(timeline): support more timeline item content kinds in replied-to details 2025-02-12 14:28:17 +01:00
Benjamin Bouvier
51e9df87f5 chore(timeline): add some logs when fetching a reply details 2025-02-12 14:28:17 +01:00
Benjamin Bouvier
aec4d37a2e refactor(event cache): fold all_deduplicated computation into collect_valid_and_duplicated_events 2025-02-12 14:10:14 +01:00
Benjamin Bouvier
ceafc2155f refactor(event cache): move the Deduplicator instance to RoomEventCacheState
The `RoomEvents` doesn't hold the `Deduplicator` instance now, it's the
role of the `RoomEventCacheState`. This slightly simplifies the code, in
a few cases.
2025-02-12 14:10:14 +01:00