14089 Commits

Author SHA1 Message Date
Jorge Martín
76651aec69 refactor: don't use full namespace for std::Result 2025-12-03 15:41:42 +01:00
Jorge Martín
e1cda064ee refactor: hopefully fix another lint error 2025-12-03 15:41:42 +01:00
Jorge Martín
94e5dbea0c refactor: hide optimize_store methods, add warnings to not use them in production
Also fix lint issue
2025-12-03 15:41:42 +01:00
Jorge Martín
c6e7a17f65 feat(ffi) Add Client::optimize_stores method 2025-12-03 15:41:42 +01:00
Jorge Martín
1e7bc1286e refactor: Add trace log to ensure the VACUUM operation has finished successfully
This was a bit confusing, because I treated a lack of logs as success when in reality my code was calling an empty implementation
2025-12-03 15:41:42 +01:00
Jorge Martín
b04cc9fe27 feat: Implement the new Store::optimize method added in the store traits
Only SQLite based stores will implement it for now, calling the `SqliteAsyncConnExt::vacuum` method
2025-12-03 15:41:42 +01:00
Jorge Martín
054dc31ce4 feat(sdk): Add Client::optimize_stores
This method should trigger any optimization/maintenance behaviours available to the stores, like `VACUUM` in SQLite
2025-12-03 15:41:42 +01:00
Ivan Enderlin
aaff9c5d72 test: Update tests according to last patches. 2025-12-03 13:11:40 +01:00
Ivan Enderlin
b1773d33c2 fix(sqlite): Make it possible to store the new SendRequestKey format. 2025-12-03 13:11:40 +01:00
Ivan Enderlin
090351c6ac doc(sqlite): Fix mention of a method.
This patch fixes a mention to a `save_send_queue_event` method. It
doesn't exist: it's `save_send_queue_request`.
2025-12-03 13:11:40 +01:00
Ivan Enderlin
045eb3486b test: Use SerializableEventContent::new instead of from_raw.
This patch replaces calls to `SerializableEventContent::from_raw` by
`new`: it's simpler and safer as it's not possible to use an invalid
event type.
2025-12-03 13:11:40 +01:00
Ivan Enderlin
40738ae119 feat(sdk): The Send Queue stores the sent event in the Event Cache.
The event has been sent to the server and the server has received it.
Yepee! Now, we usually wait on the server to give us back the event via
the sync.

Problem: sometimes the network lags, can be down, or the server may be
slow; well, anything can happen. It results in a weird situation where
the user sees its event being sent, then disappears before it's received
again from the server.

To avoid this situation, this patch eagerly saves the event in the Event
Cache. It's similar to what would happen if the event was echoed back
from the server via the sync, but we avoid any network issues. The Event
Cache is smart enought to deduplicate events based on the event ID, so
it's safe to do that.
2025-12-03 13:11:40 +01:00
Doug
acc66266c7 fix: Don't show a syncing indicator until the sync service is started. 2025-12-03 12:04:31 +01:00
Ivan Enderlin
e6094e6b07 chore: Use our own fork of indexed-db-futures.
This patch uses our own fork of `indexed-db-futures`: `matrix-indexed-db-futures`.
2025-12-03 11:59:50 +01:00
Johannes Marbach
ea538351e9 docs(timeline): clarify what mark_as_read actually does
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-12-03 11:58:16 +01:00
Ivan Enderlin
b4d7881a58 chore: Reduce the number of logs.
This patch removes some logs around the cross-process lock methods. This
is called pretty often by the cross-process lock task, which pollute the
log files.
2025-12-02 21:59:46 +01:00
Stefan Ceriu
8c4a19bb85 fix(ffi): remove undesired network request from the client builder
Making network requests before actually building a client interferes with offline support, especially so in lie-fi situations.
The method is exposed through FFI though and can be used at the final user's discretion (e.g. when submitting a bug report).
2025-12-02 18:37:10 +01:00
Doug
017644864a chore: Add tests for message-like read receipt tracking. matrix-sdk-ffi/20251202 2025-12-02 15:36:34 +01:00
Doug
59604713e8 chore: Re-use the existing track_read_receipts setting to hide receipts on state events.
# Conflicts:
#	bindings/matrix-sdk-ffi/CHANGELOG.md
2025-12-02 15:36:34 +01:00
Doug
d563cebcfc feat: Allow Timelines to be configured to hide read receipts on state events. 2025-12-02 15:36:34 +01:00
Ivan Enderlin
19b7036119 doc: Fix typos. 2025-12-02 11:54:31 +01:00
dependabot[bot]
d6b942d3ac chore(deps): bump crate-ci/typos from 1.39.2 to 1.40.0
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.39.2 to 1.40.0.
- [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.39.2...v1.40.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 11:54:31 +01:00
Kévin Commaille
c1302c417a feat(sdk): Allow to refresh the token in Client::fetch_server_versions
We need to handle 2 possible deadlocks for this:

1. We cannot try to refresh an expired access token if this call happens
   while we are currently trying to refresh the token. The easiest way
   to handle this is to never try to refresh the token when making this
   call inside `get_path_builder_input()` so we implement a "failsafe"
   mode that disables refreshing the access token in case it expired.
   However it attempts the GET /versions again without the token.
2. We cannot access the cached supported versions if we are in the
   process of refreshing that cache because the RwLock has a write lock.
   So if the access token has expired and we try to refresh it, the
   possible calls to `get_path_builder_input()` must not wait for a read
   lock to be available. So the solution is to never wait for a read
   lock, and skip the cache if a read lock is not available.

This also gets rid of workarounds in other functions.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-02 10:51:49 +00:00
Kévin Commaille
176684a07c feat(sdk): Keep track of whether the access token is expired
This will allow to handle automatically whether to send an access token
or not on endpoints that don't require it in contexts were can't refresh
it.

We also don't cache calls to GET /versions that were not authenticated,
because they might lack some features compared to an authenticated
request.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-02 10:51:49 +00:00
Kévin Commaille
be9e7ac9bf test(sdk): Handle more cases with ExpectedAccessToken
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-02 10:51:49 +00:00
Kévin Commaille
407621f055 refactor(sdk): Add constructor for AuthCtx
Allows to have stricter visibility for the fields and put less code in
ClientBuilder.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-02 10:51:49 +00:00
Kévin Commaille
bbc6df78ae refactor(sdk): Put ruma-federation-api dependency behind a feature
In theory clients shouldn't make requests to the server-server API. A
way to work around it for this specific case would be to implement
MSC4383.

In the meantime, clients that don't want to use
`Client::server_vendor_info()` won't have to build the extra
dependencies added by ruma-federation-api.

The feature is enabled for the bindings, so it isn't a breaking change
for matrix-sdk-ffi.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-02 11:04:49 +01:00
Mauro
9f02dcd412 ffi(bindings): added is_space to the NotificationRoomInfo (#5907)
Exposes the `is_space` flag to FFI in the `NotificationRoomInfo`, so
that a client can tell through a notification if the room that generated
it, is a space or not.
2025-12-02 09:31:53 +00:00
Ivan Enderlin
ab98028a2e feat(sdk): An edit can be a LatestEventValue if it targets the immediate previous event.
This patch changes the rule of what is a `LatestEventValue` candidate
in case of an edit. An edit must target/relate to its immediate previous
event to be a candidate. Otherwise it's easy to edit an old message
and create a “broken” `LatestEventValue` because it points to an older
message that the user may not be able to find easily.
2025-12-01 16:28:24 +01:00
Ivan Enderlin
7c7cbb2566 feat(sdk,ui): Support edits as LatestEventValue.
This patch supports any edits at a possible `LatestEventValue`
candidate.
2025-12-01 16:28:24 +01:00
Ivan Enderlin
32b4bbc1b0 test(ui): Use the EventFactory. 2025-12-01 16:28:24 +01:00
Kévin Commaille
e47867f232 refactor(sdk): Split supported versions and well-known cache
The supported versions are necessary for querying almost all endpoints,
but after homeserver auto-discovery the well-known info is only
necessary to get the MatrixRTC foci advertised by the homeserver. So it
shouldn't be necessary to always request both at the same time.

Besides:

- Not all clients support MatrixRTC, so they don't need the well-known
  info.
- The well-known info is only supposed to be used for homeserver
  auto-discovery before login. In fact, the MatrixRTC MSC was changed to
  use a new endpoint for this.
- We don't have access to the server name after restoring the Client, so
  the well-known lookup is more likely to fail.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-01 15:22:48 +00:00
Kévin Commaille
4411274b12 refactor(base): Split TTL store logic from ServerInfo into new type
To make it reusable.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-01 15:22:48 +00:00
Kévin Commaille
32b72580da Commit changed Cargo.lock
This seems to come from a previous commit?

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-01 15:22:48 +00:00
Ivan Enderlin
73449f4f57 doc(sdk): Add #5908 in the CHANGELOG.md. 2025-11-27 17:23:47 +01:00
Ivan Enderlin
bbe35e8190 fix(sdk): A new local LatestEventValue can be “cannot be sent”.
This patch fixes a bug where a new local `LatestEventValue`
was always created as `LocalIsSending`. It must be created as
`LocalCannotBeSent` if a previous local `LatestEventValue` exists and is
`LocalCannotBeSent`.

This patch adds the companion test too.
2025-11-27 17:23:47 +01:00
Marcel-Nordeck
107fc07d08 Wasm improvements for the bindings
This patch improves the Wasm support of the matrix-sdk-ffi crate.

First a uniffi feature needed to be enabled.
Secondly a bunch of methods which don't work under Wasm have been stubbed out.

Signed-off-by: MTRNord <MTRNord@users.noreply.github.com>
Co-authored-by: MTRNord <MTRNord@users.noreply.github.com>
2025-11-27 15:46:33 +01:00
Damir Jelić
4585d5f4d8 docs(search): Remove the example depending on the matrix-sdk crate
Examples are great, but the circular dependency this introduces is not
worth the trouble.
2025-11-27 14:34:35 +01:00
Damir Jelić
239203a813 fix: The search crate doesn't actually depend on the main crate
This removes a circular dependency we had resulting in a semi-broken
release process.
2025-11-27 14:34:35 +01:00
Damir Jelić
24d7518a01 chore: Allow release branches for cargo release as well 2025-11-27 11:10:32 +01:00
Damir Jelić
e6059251d0 Merge pull request #5901 from matrix-org/poljar/release-0.15.0 2025-11-27 10:39:45 +01:00
Damir Jelić
f4fef6e995 chore: Fix the dates of the 0.15.0 release 2025-11-27 10:07:41 +01:00
Damir Jelić
850b7dde6d chore: Release matrix-sdk version 0.15.0 2025-11-26 15:44:26 +01:00
Damir Jelić
700c17f383 release: Allow release preparation to work on the HEAD
This is to allow Jujutsu users to use the cargo-release tooling.
2025-11-26 15:38:29 +01:00
Doug
9e842a5d07 spaces: Add support for getting a flattened list of editable spaces. 2025-11-26 13:06:49 +01:00
Doug
18175c1cd0 chore: Use a common add_space_rooms function for tests. 2025-11-26 13:06:49 +01:00
dependabot[bot]
100a04ae2c chore(deps): bump CodSpeedHQ/action from 4.3.3 to 4.4.1
Bumps [CodSpeedHQ/action](https://github.com/codspeedhq/action) from 4.3.3 to 4.4.1.
- [Release notes](https://github.com/codspeedhq/action/releases)
- [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md)
- [Commits](bb005fe1c1...346a2d8a8d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-26 10:30:10 +01:00
dependabot[bot]
3a655083d6 chore(deps): bump bnjbvr/cargo-machete
Bumps [bnjbvr/cargo-machete](https://github.com/bnjbvr/cargo-machete) from 04b9adbd8c1c00963289b5628510dd907b27dc60 to 10aef304cba9ef99dacee57a756c14892391cdca.
- [Release notes](https://github.com/bnjbvr/cargo-machete/releases)
- [Changelog](https://github.com/bnjbvr/cargo-machete/blob/main/CHANGELOG.md)
- [Commits](04b9adbd8c...10aef304cb)

---
updated-dependencies:
- dependency-name: bnjbvr/cargo-machete
  dependency-version: 10aef304cba9ef99dacee57a756c14892391cdca
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-26 09:51:58 +01:00
dependabot[bot]
46947be662 chore(deps): bump crate-ci/typos from 1.39.0 to 1.39.2
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.39.0 to 1.39.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.39.0...v1.39.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-26 09:51:05 +01:00
Johannes Marbach
fccafd8c80 feat(oauth): expose session expiration errors when requesting login with a QR code
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-11-26 09:50:11 +01:00