Commit Graph

10097 Commits

Author SHA1 Message Date
Mauro Romito
3a44b50518 docs: changelog added 2026-05-26 12:33:08 +03:00
Mauro Romito
55262807e1 feat (bindings): expose tile_server to FFI 2026-05-26 12:33:08 +03:00
Ivan Enderlin
1205c2b212 doc(sdk): Add the changelog file. 2026-05-22 11:23:24 +02:00
Ivan Enderlin
eb6d5c330c test(sdk): Add a test to ensure no Client cyclic reference with ThreadSubscriptionCatchup. 2026-05-22 11:23:24 +02:00
Ivan Enderlin
b01ce21a24 fix(sdk): Remove a cyclic reference of Client in ThreadSubscriptionCatchup.
This patch fixes cyclic reference of `Client` in
`ThreadSubscriptionCatchup`.

`ThreadSubscriptionCatchup` starts a task that call
`thread_subscriptions_catchup_task`. This function captures a clone of
`ThreadSubscriptionCatchup` (why not…) which contains a `WeakClient`,
all good, no cycle here! However, the real task (not the function)
captures `Client` to call `enabled_thread_subscriptions` to know
if the function `thread_subscriptions_catchup_task` must be called.
Consequently, the task captures a clone of `Client`, boom, we have
a cycle.

This patch fixes the problem by spawning the task if and only if
`Client::enabled_thread_subscriptions` returns `Ok(true)`. This check is
done outside the task. It seems saner and avoid creating this cycle.

Consequently, the `ThreadSubscriptionCatchup::new` method becomes
`async`, which is perfectly fine as it was already wrapper inside an
`async` block when initialised by the `Client`.
2026-05-22 11:23:24 +02:00
Michael Goldenberg
b847983dbf refactor(base): hold state store lock while processing sync response
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2026-05-21 12:34:28 +02:00
Daniel Anderson
d3c499ddbc feat(sdk): expose append parameter on Pusher::set
Forwards the Matrix spec's append flag on POST /_matrix/client/v3/pushers/set
through Pusher::set. When true, the homeserver keeps any existing pusher
with the same app_id and pushkey registered for other users instead of
replacing it. Needed for multi-profile clients on a single device.

Breaking change: Pusher::set now takes an append: bool parameter.

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
2026-05-21 12:53:08 +03:00
Damir Jelić
82c24a891b fix(sdk): Make the pinned events sorting deterministic
The previous sorting logic relied on SystemTime::now, which introduces
non-deterministic behavior which might result in a panic.
2026-05-20 16:54:20 +02:00
Hugh Nimmo-Smith
3372ca3577 test(sdk): explicitly assert homserver URL swap for QR login 2026-05-20 15:56:33 +02:00
Daniel Anderson
a80fa910da feat(base): expose m.fully_read event ID on RoomInfo
Persist `m.fully_read` on `BaseRoomInfo` and expose it
on `RoomInfo::fully_read_event_id` and `Room::fully_read_event_id`.

The `m.fully_read` response processor now stores the event ID
on the room info and emits `RoomInfoNotableUpdateReasons::FULLY_READ`

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
2026-05-20 11:46:20 +03:00
Daniel Anderson
4b1ae064c7 feat(base): add FULLY_READ notable update reason
Add `RoomInfoNotableUpdateReasons::FULLY_READ`, used for
when the `m.fully_read` marker for a room changes.

Breaking change: the backing bitflag widens from `u8` to `u16`
for the new flag to not alter the existing bit positions.

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
2026-05-20 11:46:20 +03:00
Ivan Enderlin
b6d0f8a0a7 chore: Fix rumdl errors and warnings by hand. 2026-05-18 15:05:52 +02:00
Ivan Enderlin
7d31912f0d chore: Run rumdl check --fix. 2026-05-18 15:05:52 +02:00
Kévin Commaille
edb5d41597 refactor(sdk): Make RumaApiError a type alias of UiaaResponse
They have similar variants containing the same data so it's not useful
to have separate types.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-05-15 12:04:54 +02:00
Kévin Commaille
6a551f31e2 refactor(sdk): Simplify some error matching
By using helper methods on error types.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-05-15 12:04:54 +02:00
Kévin Commaille
44a12a7849 refactor(sdk): Use upstream method to match unsupported endpoint error
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-05-15 12:04:54 +02:00
Jorge Martín
7c13b60e28 fix: Refresh timeline items when their sender's avatar URL changes
This is similar to what happens when a user display name changes, its ambiguity is calculated and if it changes, it reloads the associated timeline events.

In fact, this change tries to follow the same strategy as `AmbiguityCache`.
2026-05-15 11:56:27 +02:00
Damir Jelić
e5a50089c2 chore: Migrate changelogs to towncrier fragments 2026-05-15 11:15:38 +02:00
Damir Jelić
2a8d75e43f chore: Add the changelog fragment directories 2026-05-14 15:56:14 +02:00
Damir Jelić
8fb918e062 chore: Update our changelogs so towncrier knows where to insert changelogs 2026-05-14 15:56:14 +02:00
Benoit Marty
c253114b05 fix: can_be_replied_to() returns false for LiveLocation events. 2026-05-13 13:38:12 +01:00
Stefan Ceriu
6792416efb chore(timeline): replace duplicate read receipt panic with plain error 2026-05-12 17:25:48 +03:00
Stefan Ceriu
2497f0ebd3 chore(stores): switch from pause/resume semantics to close and reopen ones 2026-05-12 17:25:48 +03:00
Stefan Ceriu
e72841ab79 change(stores): remove the default pause/resume implementations and replace them with concrete ones. 2026-05-12 17:25:48 +03:00
Stefan Ceriu
3f6887a69e chore(doc): update the documentation around pausing an resuming stores 2026-05-12 17:25:48 +03:00
Stefan Ceriu
e46cd9870d feat(client): expose a client pause/resume mechanism throughout the SDK
This patch exposes the pause/resume mechanism for SDK stores all the way up to
the FFI `Client`, so apps can temporarily release SQLite resources when moving
to the background and re-acquire them on resume.

The main use case is iOS backgrounding, where keeping SQLite file descriptors and
locks open can contribute to `0xdead10cc` terminations by the operating system.
2026-05-12 17:25:48 +03:00
Stefan Ceriu
8e8e0ebef9 chore(tests): add pause/resume mechanism tests for all the stores 2026-05-12 17:25:48 +03:00
Stefan Ceriu
40d57cb717 feat(stores): implement pause/resume support in the crypto, event cache, state and media SQLite stores
This patch implements the main pause/resume logic in the underlying SDK stores.
The in memory stores no-op trough the default trait implementations.

The main change are limited to the sqlite crate:
- a new type called `SqliteConnections` has been introduced which now holds a
store's read connection pools as well as the always on write connection. This
lives as an optional on each store's level and gets set to None whenever the
store is paused
- during the pausing phase `SqliteConnections` (through its `pause_connections`
method) does the following:
    - closes the read pool, directly dropping idle connections
    - waits for in flight writes to finish
    - tries a best effort WAL checkpoint
    - drops the write connection on a blocking thread
    - and waits for in-flight read connections to drain
    - this is all best effort with an eventual timeout
- resuming connections is also shared between the stores through
`SqliteConnections` and consists in building a new pool with the previous
configuration and creating a new write connection

# Conflicts:
#	crates/matrix-sdk-sqlite/src/crypto_store.rs
#	crates/matrix-sdk-sqlite/src/event_cache_store.rs
#	crates/matrix-sdk-sqlite/src/media_store.rs
#	crates/matrix-sdk-sqlite/src/state_store.rs
2026-05-12 17:25:48 +03:00
Stefan Ceriu
a0fbcd407b feat(stores): add pause and resume trait definitions and default implementations for all the stores 2026-05-12 17:25:48 +03:00
Jorge Martín
2d8b3cee25 doc: Add changelog entries 2026-05-11 16:40:09 +02:00
Jorge Martín
8b5bc935ea refactor: Use AsyncMutex to avoid most of the issues about the MutexGuard and .await 2026-05-11 16:40:09 +02:00
Jorge Martín
dd128d47be refactor: Make SpaceRoom::new_from_summary async too 2026-05-11 16:40:09 +02:00
Jorge Martín
29343233b7 refactor: Make SpaceRoom::new_from_known async so we can properly compute is_dm 2026-05-11 16:40:09 +02:00
Damir Jelić
58141e422d Merge pull request #6559 from matrix-org/poljar/merge-release-0-16-back
Merge the 0.16-release branch back to main
2026-05-11 15:44:23 +02:00
Ivan Enderlin
65072dd8a8 chore: Use values() instead of iter() and discard the keys. 2026-05-10 20:32:14 +02:00
Ivan Enderlin
73c27d8062 chore(sdk): Avoid cloning an OwnedUserId.
This patch uses `slice::from_ref` to create a `&[T]` from a `&T`. In our
case, it saves the cost of one clone.
2026-05-10 20:32:14 +02:00
Damir Jelić
08222e300b Merge branch 'release-0.16' into main 2026-05-08 16:30:55 +02:00
Damir Jelić
ed148665d2 chore: Release matrix-sdk version 0.16.1 2026-05-08 15:57:42 +02:00
Damir Jelić
cf099deb27 chore: Release matrix-sdk version 0.17.0 2026-05-08 14:05:41 +02:00
gewitternacht
92ba0a8672 chore: Add a changelog entry for user ID check in the embedded device keys 2026-05-08 13:56:25 +02:00
Hubert Chathi
ca0b00c5bf Check the user ID in the embedded device keys 2026-05-08 13:54:13 +02:00
gewitternacht
f4b27943a0 chore: Add a changelog entry for user ID check in the embedded device keys 2026-05-08 13:43:36 +02:00
Hubert Chathi
86dcedfefa Check the user ID in the embedded device keys 2026-05-08 13:43:36 +02:00
Damir Jelić
209ac997d9 fix(thread): Only apply valid edits in the thread summary 2026-05-08 12:36:13 +02:00
Damir Jelić
89a7cc9596 test(latest-event): Check that we don't apply invalid edits in the latest event 2026-05-08 12:36:13 +02:00
Damir Jelić
730ec3d798 fix(latest-event): Don't apply invalid edits on the latest event 2026-05-08 12:26:50 +02:00
Damir Jelić
e0890a6c4f refactor(latest-event): Ensure we have access to the event JSON when deciding on a latest event 2026-05-08 11:32:44 +02:00
Damir Jelić
0966c0276c fix(ui): Follow the spec more closely in how we reject invalid edits 2026-05-08 11:01:38 +02:00
Damir Jelić
0d82c6f214 test(common): Add some tests to validate the edit validation logic 2026-05-08 11:01:38 +02:00
Damir Jelić
cb166ba458 feat(common): Add a function to validate edits 2026-05-08 10:13:07 +02:00