Commit Graph

14124 Commits

Author SHA1 Message Date
Jorge Martín
3be6fb1a80 fix(sqlite): Add WAL checkpoints when vacuuming
For some reason, the automatic WAL checkpoints don't seem to be working as expected. Since we should periodically run VACUUM operations, we might as well add checkpoints before vacuuming (so the WAL size is reset and can grow to fit the whole DB) and after (so we clean up after that).
2026-01-07 16:11:40 +01:00
Ivan Enderlin
5dcd877dcd test(ui): Sticky parameters have been removed. 2026-01-07 14:05:59 +01:00
Ivan Enderlin
ed1c847e7b doc(sdk): Update the `CHANGELOG.md. 2026-01-07 14:05:59 +01:00
Ivan Enderlin
87962d10e2 test(sdk): Test Request::extensions::to_device::since is set.
This patch restores a couple of assertions from a recently removed
test where it is asserted that `Request::extensions::to_device::since`
is set from the Olm machine.
2026-01-07 14:05:59 +01:00
Ivan Enderlin
4ac4ad3440 chore(sdk): Remove the sticky_parameters module.
This patch removes the `sticky_parameters` module, which is now unused.
2026-01-07 14:05:59 +01:00
Ivan Enderlin
742b6e5200 chore(sdk): Sliding Sync list filters is no longer sticky.
This patch extracts `SlidingSyncListStickyParameters::filters` to
no longer make it sticky. We are dropping sticky parameters as it's not
part of the last MSC.
2026-01-07 14:05:59 +01:00
Ivan Enderlin
43657d8302 chore(sdk): Sliding Sync list required_state is no longer sticky.
THis patch extracts `SlidingSyncListStickyParameters::required_state` to
no longer make it sticky. We are dropping sticky parameters as it's not
part of the last MSC.
2026-01-07 14:05:59 +01:00
Ivan Enderlin
b28999e40c chore(sdk): Inline and always apply SlidingSyncStickyManager.
This patch removes `SlidingSyncStickyManager` as it only contains
the logic for a single request field: `room_subscriptions`. Also,
previously, `room_subscriptions` was considered sent based on the
transaction ID. This is useless as it's always sticky per MSC4186. The
logic from `SlidingSyncStickyManager` is sent inlined, allowing to
effectively remove this type.
2026-01-07 14:05:59 +01:00
Ivan Enderlin
42de8307bf chore(sdk): Sliding Sync extensions is no longer sticky.
This patch extracts `SlidingSyncStickyParameters::extensions` to no
longer make it sticky. We are dropping sticky parameters as it's not
part of the last MSC.
2026-01-07 14:05:59 +01:00
Jorge Martín
48d1d1f80f doc: Add changelog entry 2026-01-07 11:25:31 +01:00
Jorge Martín
d52e5cfb50 doc: Add more doc comments to Client::fetch_client_well_known 2026-01-07 11:25:31 +01:00
Jorge Martín
fe46a0cce0 fix(sdk): When using fetch_client_well_known_with_url, use the server name from the Client::user_id as a possible fallback too 2026-01-07 11:25:31 +01:00
ragebreaker
b081654c51 fix(search): Create key dirs if they don't exist. (#5992)
The issue is related to the encrypt_store_dir fn where, when creating
the key file, it doesn't ensure that the parent directory exists first.
It might be not optimal for the user of the crate to ensure in an non
hacky manner, as the sdk iterates through most of its directories
internally. Have a test to verify it, which can be removed later (if
being merged)

Needs a review, might not be the optimal solution as this is my first pr
with the crate and am not that familiar with it (although do use it in
one of my apps).
2026-01-07 11:07:36 +01:00
Skye Elliot
cc622a56ea Merge pull request #6000 from matrix-org/kaylendog/history-sharing/ui
Expose information about room key bundle forwarder in `matrix-sdk-ui` and `matrix-sdk-ffi`.
2026-01-06 16:40:10 +00:00
Skye Elliot
a5b1231f8c refactor: Deduplicate shared history test code to helper methods. 2026-01-06 16:18:33 +00:00
Skye Elliot
a8c9257dfe docs: Update CHANGELOGs. 2026-01-06 16:16:20 +00:00
Skye Elliot
bfdd3ccc07 test: Ensure forwarder info is not available on unshared events. 2026-01-06 15:00:33 +00:00
Skye Elliot
503234976f refactor: Extract forwarder data fetcing to a helper function. 2026-01-06 14:28:44 +00:00
Skye Elliot
6fdd83478a tests: Ensure forwarder info accessible via high-level API. 2026-01-06 12:59:54 +00:00
Skye Elliot
0a5a22ec6f feat(ui): Expose information about room key bundle forwarder.
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-01-06 12:15:27 +00:00
dependabot[bot]
21cad56213 chore(deps): bump CodSpeedHQ/action from 4.4.1 to 4.5.2
Bumps [CodSpeedHQ/action](https://github.com/codspeedhq/action) from 4.4.1 to 4.5.2.
- [Release notes](https://github.com/codspeedhq/action/releases)
- [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md)
- [Commits](346a2d8a8d...dbda7111f8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-06 12:02:50 +01:00
Kévin Commaille
b0a536aaeb Upgrade Ruma
Uses the newly released version.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-01-06 12:02:23 +01:00
Kévin Commaille
5ee379d588 fix(ui): Deduplicate aggregation local and remote echo
We can have 3 different states for the same aggregation in
related_events, in chronological order:

1. The local echo with a transaction ID.
2. The local echo with the event ID returned by the server after
   sending the event.
3. The remote echo received via sync.

The transition from states 1 to 2 was already handled in
`mark_aggregation_as_sent()`.
But the transition from states 2 to 3 was never handled and we ended up
with both the local echo and the remote echo in the related events.

This resulted in the local echo being chosen over the remote echo when
computing the latest edit only because it was first in the list, even
though it didn't contain the raw JSON of the edit.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-01-06 10:00:24 +00:00
Jonas Platte
ebbf34e924 Fix more new clippy lints 2026-01-06 09:51:10 +00:00
Jonas Platte
e4aff871de Refactor IndexeddbStateStore::save_changes 2026-01-06 09:51:10 +00:00
Jonas Platte
0a9994c529 Fix new clippy lints 2026-01-06 09:51:10 +00:00
Jonas Platte
06764e2542 Reformat matrix-sdk-indexeddb 2026-01-06 09:51:10 +00:00
Jonas Platte
84cd2a67d4 Upgrade matrix-sdk-indexeddb to Rust edition 2024 2026-01-06 09:51:10 +00:00
Richard van der Hoff
e3867aa7df Merge pull request #5959 from matrix-org/rav/clean_up_shield_state
Remove unused `ShieldStateCode::SentInClear`

`VerificationState::to_shield_state_{strict,lax}` return a type `ShieldState`, whose inner
type `ShieldStateCode` currently includes a variant `SentInClear` for "unencrypted event".
This is very misleading, because those functions never actually set that variant.

Rather, there is a separate method in `matrix-sdk-ui`, `EventTimelineItem::get_shield`,
which uses the same type, but *does* set that variant where appropriate.

As a user of matrix-sdk-common, without the matrix-sdk-ui layer, this is dangerously
misleading: it gives the impression that we are checking for unencrypted events, when in
fact we are not.

The solution seems to be to use different types for the different levels of the stack.

While we're at it, we fix up some of the confusion of methods that return an `Option` of an
enum type which itself has a `None` variant.
2026-01-05 16:33:54 +00:00
Skye Elliot
cd9f433358 Merge pull request #5945 from matrix-org/kaylendog/history-sharing/encryption-info
feat: Add `forwarder: ForwarderInfo` to `EncryptionInfo`.

Introduces `ForwarderInfo` which which exposes information about the forwarder of the  keys with which an event was encrypted if they were shared as part of an [MSC4268](https://github.com/matrix-org/matrix-spec-proposals/pull/4268) room key bundle.
2025-12-19 17:29:22 +00:00
Skye Elliot
42a5910d8f feat(crypto): Introduce ForwarderData for session forwader info. (#5980)
<!-- description of the changes in this PR -->

- Introduces a new enum `ForwarderData` as a wrapper for valid variants
of `SenderData` for which we can accept key bundles under MSC4268.
- Converts `forwarder_data` in `InboundGroupSession` and
`PickledInboundGroupSession` to use `Option<ForwarderData>` over
`Option<SenderData>`.

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

---------

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-12-19 14:51:15 +00:00
Richard van der Hoff
66daf3f7d3 Merge remote-tracking branch 'origin/main' into rav/clean_up_shield_state 2025-12-19 13:44:41 +00:00
Ivan Enderlin
c3c367c54c doc(base): Update CHANGELOG.md. 2025-12-19 14:03:11 +01:00
Ivan Enderlin
bf3cb6ba84 chore(sdk): Make Clippy happy :-). 2025-12-19 14:03:11 +01:00
Ivan Enderlin
5c5dcaa027 test(sdk): Add tests for new_remote and erasable values. 2025-12-19 14:03:11 +01:00
Ivan Enderlin
ca64af1390 feat(sdk): When a m.room.redaction targets the current [LatestEventValue], it must be erased.
This patch implements a new feature: when a `m.room.redaction` targets
the current [`LatestEventValue`], this one must be erased by the new
computed `LatestEventValue`.
2025-12-19 14:03:11 +01:00
Ivan Enderlin
ebe00841fd refactor(sdk): Replace bool by ControlFlow.
This patch replaces the `bool`s returned by `filter_*` functions by
`ControlFlow`s.
2025-12-19 14:03:11 +01:00
Ivan Enderlin
85f321f30a refactor(sdk): LatestEventValueBuilder receives the current value's event ID.
This patch spreads the current value's event ID in
`LatestEventValueBuilder`.

This patch also changes `LatestEventValueBuilder::new_remote` to return
an `Option`, similarly to `new_local`. The `must_overwrite_existing`
variable is set to `true` to keep the existing behaviour, but it's going
to change in the next patch.

This patch is purely a refactoring with no feature change. Most of the
changes are in test to keep track of the _previous value_ so that the
current value's event ID can be calculated instead of hardcoded.
2025-12-19 14:03:11 +01:00
Ivan Enderlin
e2ea84f3e3 chore(sdk): Rename a variable.
This patch renames a variable. Since `rfind_map_event_id_memory_by`
returns the previous event instead of the previous event ID, this
variable must have been renamed.
2025-12-19 14:03:11 +01:00
Ivan Enderlin
d5898a64ab feat(base): Add LatestEventValue::event_id.
This patch adds the `event_id` method on `LatestEventValue`, along with
the tests.
2025-12-19 14:03:11 +01:00
Ivan Enderlin
42b79d7d8a feat(base): LatestEventValue::LocalHasBeenSent gains an event_id field.
This patch adds the `event_id: OwnedEventId` field to
`LatestEventValue::LocalHasBeenSent`.
2025-12-19 14:03:11 +01:00
Ivan Enderlin
9363745fb0 chore(sdk): Remove timer! logs.
This patch removes `timer!` logs, those are no longer useful.
2025-12-19 14:03:11 +01:00
Richard van der Hoff
b5f2128db1 common: remove now-unused ShieldStateCode::SentInClear 2025-12-18 13:54:49 +00:00
Richard van der Hoff
d5ce01acab ui: new type for EventTimelineItem::get_shield
Separate the shield types between common and UI, so that we can change common
without breaking UI.

The new type does not include a `message` field: since it cannot be localised,
clients should not be using it.
2025-12-18 13:54:49 +00:00
Richard van der Hoff
dbefaef777 bindings: remove message from ShieldState
Since this can't be localised, apps shouldn't be using it.
2025-12-18 13:09:54 +00:00
Richard van der Hoff
7438c59acd bindings: get_shields: stop returning Option
Again, there is no need for an `Option` as well as a `None` variant
2025-12-18 13:07:34 +00:00
Richard van der Hoff
f5cda21d59 ui: TimelineEventItem::get_shield: stop returning Option
The `ShieldState` enum has a `None` variant, so we don't need an `Option` on
top of it.
2025-12-18 13:07:34 +00:00
Jorge Martín
759c5a9fcd docs: Add changelog entries 2025-12-18 10:41:43 +01:00
Jorge Martín
1549194b2f feat(ffi): Add an actual ffi::TimelineEventType enum with only the type
Use that for `RoomPowerLevels::events` instead.
2025-12-18 10:41:43 +01:00
Jorge Martín
4665b4343d refactor(ffi): Rename TimelineEventType to TiemlineEventContent since it also contains the event contents for some of the types 2025-12-18 10:41:43 +01:00