Commit Graph

13555 Commits

Author SHA1 Message Date
Kévin Commaille
a72c19a240 test(ui): Allow to set own user id of TestRoomDataProvider
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-09 15:08:38 +01:00
Kévin Commaille
cf4a1dee4b Upgrade Ruma after StringEnum changes
StringEnum now also implements Ord, PartialOrd, Eq and PartialEq so it
is not necessary to derive them. Also the ordering used is comparing the
string representation of the variants.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-09 15:08:38 +01:00
Kévin Commaille
487470be8f Upgrade Ruma after extended profile field stabilization
Extended profile fields were stabilized so the old endpoints are now
deprecated, and there are a few other changes.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-09 15:08:38 +01:00
Richard van der Hoff
b94823216d Merge pull request #5766 from matrix-org/rav/device_keys_self_signature
crypto: give `DeviceKeys` ability to check their own signature
2025-10-09 12:26:41 +01:00
Richard van der Hoff
232119cf57 crypto: avoid redundant conversion to DeviceData
There is (now) no need to turn the `sender_device_keys` into a `DeviceData`.
2025-10-09 11:32:09 +01:00
Richard van der Hoff
64818e2ef9 crypto: docs on Account::check_sender_device_keys (#5765)
I had to do some thinking about this, so wrote down my conclusions.
2025-10-09 11:31:30 +01:00
Richard van der Hoff
a2ded93234 crypto: give DeviceKeys ability to check their own signature
Adds `DeviceKeys::has_signed` and `DeviceKeys::check_self_signature`, and
removes `DeviceData::has_signed` and `DeviceData::verify_device_keys`.

I just found this easier to grok, and it means we can avoid needlessly turning
a `DeviceKeys` into a `DeviceData` sometimes.
2025-10-09 11:14:42 +01:00
Stefan Ceriu
fc892564d8 fix(spaces): handle empty string room names when computing the display names
Fixes #5762
2025-10-09 12:59:06 +03:00
Johannes Marbach
358803783f feat(oauth): add LoginProgress::SyncingSecrets
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-10-08 11:00:54 +02:00
Benjamin Bouvier
ef440eed2b chore(base): don't log the same missing room info log line on every single sync
This should only happen when a room has been forgotten and was a room
DMs before. Ideally, we'd clean up the room DM event data, but since
this is slightly more involved, we don't do that here just quite yet.
2025-10-07 21:03:09 +02:00
Johannes Marbach
79e1930b22 Make LoginProgres::EstablishingSecureChannel generic in order to reuse it for the other QR login flow
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-10-07 21:00:42 +02:00
Kévin Commaille
6191e2c24e fix(sdk): Make impl Stream return type not use any lifetime
With Rust 2024, by default `impl` return types use any generic that is
in scope, so in these cases the lifetime of `self`.

But since the return type is actually owned, the returned impl shouldn't
use any lifetime, which is what `use<>` does.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-07 15:22:52 +02:00
Kévin Commaille
ba2fe1d387 fix(crypto): Make impl Stream return type not use any lifetime
With Rust 2024, by default `impl` return types use any generic that is
in scope, so in these cases the lifetime of `self`.

But since the return type is actually owned, the returned impl shouldn't
use any lifetime, which is what `use<>` does.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-07 15:22:52 +02:00
Stefan Ceriu
c7b4b5dc05 chore(ffi): expose the computed SpaceRooms display name
This reuses the same naming scheme used in the FFI Room and RoomInfo
matrix-sdk-ffi/20251007
2025-10-07 15:33:36 +03:00
Stefan Ceriu
87d9bd14e3 feat(spaces): reuse existing room display name computation logic for spaces 2025-10-07 13:05:59 +03:00
Benjamin Bouvier
44a4ca94be chore: fix new typos 2025-10-06 17:39:23 +02:00
dependabot[bot]
3b43a7e5e8 chore(deps): bump crate-ci/typos from 1.36.3 to 1.37.2
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.36.3 to 1.37.2.
- [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.36.3...v1.37.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 17:39:23 +02:00
dependabot[bot]
773d304f9e chore(deps): bump CodSpeedHQ/action from 4.0.1 to 4.1.1
Bumps [CodSpeedHQ/action](https://github.com/codspeedhq/action) from 4.0.1 to 4.1.1.
- [Release notes](https://github.com/codspeedhq/action/releases)
- [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md)
- [Commits](653fdc30e6...6b43a0cd43)

---
updated-dependencies:
- dependency-name: CodSpeedHQ/action
  dependency-version: 4.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 17:19:31 +02:00
dependabot[bot]
b47174e394 chore(deps): bump bnjbvr/cargo-machete
Bumps [bnjbvr/cargo-machete](https://github.com/bnjbvr/cargo-machete) from 7c2dc36a6fe4a75848d9397e34c95474f38c82ef to 744a6d5e0db5d189ad36edb08c5f77107cc42310.
- [Release notes](https://github.com/bnjbvr/cargo-machete/releases)
- [Changelog](https://github.com/bnjbvr/cargo-machete/blob/main/CHANGELOG.md)
- [Commits](7c2dc36a6f...744a6d5e0d)

---
updated-dependencies:
- dependency-name: bnjbvr/cargo-machete
  dependency-version: 744a6d5e0db5d189ad36edb08c5f77107cc42310
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 17:11:40 +02:00
Damir Jelić
b1e0339159 ci: Add the crypto team as CODEOWNERS for the indexeddb crypto store implementation 2025-10-06 14:58:37 +02:00
Benjamin Bouvier
7fbc4144b1 feat(timeline): allow a poll edit to be an embedded event
This will properly show edited polls as the latest thread id, as a nice
benefit.
2025-10-06 14:05:34 +02:00
Benjamin Bouvier
a2a26ae45e refactor(timeline): pass directly the poll start and fallback text to PollState ctor 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
06301bc2f8 refactor(timeline): store fewer datum a in PollState
We don't really need the poll start event entirely, since we're only
interested in the start block and the fallback text. With this, it'll be
simpler to create embedded polls from poll edit events.
2025-10-06 14:05:34 +02:00
Benjamin Bouvier
85abe76121 feat(timeline): also support poll edits as embedded events 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
97ff61081a feat(timeline): support edits in embedded events 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
0017ccb0c1 feat(event cache): update a thread summary if an edit related to the latest thread reply 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
350fdd8ad4 feat(common): add support for extracting only an edited target event id from an edit event 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
f937bf60e2 refactor(event cache): make naming more consistent around latest thread event 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
da394f5015 refactor(event cache): update the thread summary in a separate function 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
158e3925b7 refactor(event cache): don't collect back-paginated events that are going to be filtered out immediately 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
4828f4c555 refactor(event cache): rename save_event to save_events as it's involving multiple events 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
92e7cb3af2 refactor(event cache): save the content of threaded events in the store 2025-10-06 14:05:34 +02:00
Benjamin Bouvier
a6a590aa1f test(timeline): add a test that an edit to a thread's latest event updates the thread summary 2025-10-06 14:05:34 +02:00
Kévin Commaille
d01a28c9b2 Upgrade Ruma
Brings a breaking change with event structs being non-exhaustive now,
so they need to be constructed with methods rather than with a struct
declaration.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-06 10:21:00 +02:00
Johannes Marbach
68075b65fb refactor(auth): make auxiliary functions reusable outside LoginWithQrCode
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-10-04 09:41:16 +02:00
Kévin Commaille
d4d40945e8 refactor(tests): Use EventFactory to build events
There is a breaking change in Ruma and those types are now
non-exhaustive so they can't be built with the struct declaration
anymore.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-03 17:01:58 +02:00
Kévin Commaille
2b69a7f741 feat(sdk-test): Add conversions to deserialized types for EventBuilder
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-03 17:01:58 +02:00
Stefan Ceriu
d85b45ed64 feat(spaces): sort space room list rooms as defined in the spec
The ordering criteria is defined at https://spec.matrix.org/latest/client-server-api/#ordering-of-children-within-a-space. The gist is that `order` comes first, then `timestamp` and finally the `room_id`

This is not available for top level spaces, but there is an MSC that addresses it at https://github.com/matrix-org/matrix-spec-proposals/pull/3230 and Ruma support has been added in https://github.com/ruma/ruma/pull/2231. The SDK side implementation for that will come in a later PR.
2025-10-03 15:22:52 +02:00
Stefan Ceriu
b43237536d chore(spaces): store the full children_state data when fetching /hierarchy 2025-10-03 15:22:52 +02:00
Kévin Commaille
fbafae42bb refactor(tests): Replace uses of EventBuilder::into_raw
We actually want other event formats in those cases, and in most cases
just using `.into()` is enough to generate the proper format.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-03 15:22:25 +02:00
Kévin Commaille
08563d4096 refactor(sdk-test): Use enum to represent possible event formats of EventBuilder
And use the proper fields for these formats. We also add more conversion
implementations for the types associated with these formats.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-03 15:22:25 +02:00
Andy Balaam
32f3670aeb task(crypto): Warn API users to fetch device info before processing verification requests 2025-10-03 14:21:44 +01:00
Ivan Enderlin
8a23aae9dc perf(common): Compute the message in TracingTimer when required (#5662)
This patch moves the creation of the `message` in `TracingTimer` if and
only if the log is enabled. Computing it every time is useless, and can
even slow things down (because of the time calculation).
2025-10-03 15:19:47 +02:00
Jorge Martín
2822815384 feat(ffi): Add NotificationSettings::get_raw_push_rules
This allows clients to get the raw push rules so they can be added to bug reports if needed
2025-10-03 15:16:07 +02:00
Ivan Enderlin
a7cb094aaf feat(sqlite): Add a write-only connection in SqliteStateStore.
This patch introduces a write-only connection in `SqliteStateStore`
_à la_ `SqliteEventCacheStore`. The idea is to get many read-only
connections, and a single write-only connections behind a lock, so that
there is a single writer at a time.

This patch renames the `acquire` method to `read`, and it introduces a
new `write` connection.
2025-10-03 15:00:37 +02:00
Ivan Enderlin
764a8a4c77 doc(sqlite): Fix // to ///.
This patch transforms an inline comment into a doc comment.
2025-10-03 15:00:37 +02:00
mgoldenberg
2e6790d0a5 IndexedDB: upgrade indexed_db_futures dependency (#5722)
**NOTE:** _this should not be merged until matrix-org/rust-indexed-db#1
is merged! The `[patch]` in this branch should point to the official
`matrix-org` fork of `rust-indexed_db`, but is currently pointed at my
personal fork._

## Background

This pull request makes updates
[`indexed_db_futures`](https://docs.rs/indexed_db_futures/latest/indexed_db_futures/index.html)
in the `matrix-sdk-indexeddb` crate. The reason we'd like to update this
dependency is because the version currently used does not fully support
the Chrome browser (see #5420).

The latest version of `indexed_db_futures` has significant changes. Many
of these changes can be integrated without issue. There is, however, a
single change which is incompatible with the `matrix-sdk-indexeddb`
crate. Namely, one cannot access the active transaction in the callback
to update the database (for details, see Alorel/rust-indexed-db#66).

### An Updated Proposal

Originally, new migrations were implemented in order to work around this
issue (see #5467). However, the proposal was ultimately rejected (see
@andybalaam's
[comment](https://github.com/matrix-org/matrix-rust-sdk/pull/5467#issuecomment-3149550617)).

For this reason, the dependency has instead been `[patch]`ed in the
top-level `Cargo.toml` with a modified version of `indexed_db_futures`
(see matrix-org/rust-indexed-db#1). Furthermore, these changes have been
proposed to the maintainer and are awaiting feedback (see
Alorel/rust-indexed-db#72).

### Why do we need the active transaction in our migrations?

The `crypto_store` module provides access to the active transaction to
its migrations (see
[here](ca89700dfe/crates/matrix-sdk-indexeddb/src/crypto_store/migrations/mod.rs (L211))).
Furthermore, there is a single migration (`v11_to_v12`) in the
`crypto_store` module which actually makes use of the active transaction
(see
[here](ca89700dfe/crates/matrix-sdk-indexeddb/src/crypto_store/migrations/v11_to_v12.rs (L23))).

For clarity, the reason `v11_to_v12` is problematic in the latest
versions of `indexed_db_futures` is because it is simply adding an index
to an object store which was created in a different migration and this
requires access to the active transaction. All the other migrations
create object stores and indices in the same migration, which does not
suffer from the same issue.

## Changes

- Move `indexed_db_futures` to the workspace `Cargo.toml` and add a
`[patch]` so that it points to a modified version.
- Add `GenericError` type and conversions in order to more easily map
`indexed_db_futures` errors into `matrix-sdk-*` errors.
- Update all IndexedDB interactions so that they use the upgraded
interface provided by `indexed_db_futures`
- Add functionality for running `wasm-pack` tests against Chrome


---
Closes #5420.

---

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


Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>

---------

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-10-03 14:10:10 +02:00
Stefan Ceriu
67d8db3d93 fix(spaces): filter out non-joined rooms from the space leaving process and handle 2025-10-03 13:43:14 +03:00
Ivan Enderlin
52518e0e2e fix(sdk): Use RoomPowerLevels::user_can_kick_user in filter_any_sync_state_event.
This patch replaces `user_can_kick` by `user_can_kick`: it performs an
extra check to make sure the acting user has at least the same power
level as the target user.
2025-10-03 12:37:37 +02:00
Kévin Commaille
b8b54246c4 Silence unused-imports lint
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-10-03 12:27:50 +03:00