Commit Graph

13223 Commits

Author SHA1 Message Date
Benjamin Bouvier ed2ab3ffe6 timeline: rename any_timeline_item_by_txn_id to item_by_transaction_id 2024-07-22 11:32:09 +02:00
Benjamin Bouvier 30c401ac75 timeline: rename item_by_transaction_id to local_item_by_transaction_id 2024-07-22 11:32:09 +02:00
Benjamin Bouvier bbae5364b3 timeline: update comments and error types for Timeline::redact
Yay, one fewer error type for the timeline.
2024-07-22 11:32:09 +02:00
Benjamin Bouvier ec057cf354 timeline: update comments around Timeline::edit 2024-07-22 11:32:09 +02:00
Benjamin Bouvier d4ad2b26cd timeline: remove unused error variants 2024-07-22 11:32:09 +02:00
Benjamin Bouvier 9b1b67fa09 timeline: rationalize edit/abort 2024-07-22 11:32:09 +02:00
Benjamin Bouvier 07f5289e7e release: Update Cargo.lock file 2024-07-22 10:57:25 +02:00
Damir Jelić d65e33ca6a Merge branch '0.7-release' into main matrix-sdk-ffi/20240722 2024-07-19 12:02:40 +02:00
Ivan Enderlin 730d5a3803 fix(base): Fix a bug when an invite has no timestamp.
The sliding sync proxy has a bug: despite the presence of
`m.room.create` in `bump_event_types`, an invite with an `m.room.create`
event will not have a `timestamp`. Thus, such a room cannot be sorted
reliably.

This patch fixes this problem with a terrible hack, where it tries to
find an `origin_server_ts` value from within the `invite_state` state
events.

Please read the comment to learn more.
2024-07-19 11:39:14 +02:00
Ivan Enderlin 23a232e99f fix(base): Add the from_simplified_sliding_sync argument to BaseClien::process_sliding_sync. 2024-07-19 11:39:14 +02:00
Damir Jelić 4f79a15fa9 qrcode: Bump the version 0.7.1-qrcode 2024-07-19 11:05:14 +02:00
Damir Jelić dda080c497 sqlite: Bump the version 0.7.1-sqlite 2024-07-19 10:18:27 +02:00
Damir Jelić 11d5e56892 chore: Fix a formatting issue that snuck in while doing a security release 2024-07-18 17:31:55 +02:00
Damir Jelić 8b0d6afe4b Merge branch '0.7-release' into main 2024-07-18 17:26:18 +02:00
Damir Jelić a18f90bfaa chore: Fix some invalid test data 0.7.2-crypto 2024-07-18 17:10:00 +02:00
Damir Jelić 60ed367fd9 chore: Format the changelog a bit better 2024-07-18 17:10:00 +02:00
Damir Jelić 1157067dba chore: Prepare the matrix-sdk-crypto release 0.7.2 2024-07-18 17:10:00 +02:00
Damir Jelić 8efdba6136 crypto: Fix UserIdentity::is_verified to take into account our own identity
The `UserIdentity::is_verified()` method in the matrix-sdk-crypto crate
before version 0.7.2 doesn't take into account the verification status
of the user's own identity while performing the check and may as a result
return a value contrary to what is implied by its name and documentation.

This patch fixes this and adds a regression test.

The method itself is not used internally and as such has not a larger
impact.

Co-authored-by: Denis Kasak <dkasak@termina.org.uk>
Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2024-07-18 17:10:00 +02:00
Damir Jelić 1029e51eb3 chore: Use a released version of vodozemac (#3721) 2024-07-18 17:10:00 +02:00
Ivan Enderlin 5679a45f75 fix(ui): RoomList reacts to all RoomInfoNotableUpdate.
The `RoomList` provides a `Stream<Item = Vec<VectorDiff<Room>>>`.
This `Stream` receives updates from 2 sources: `RoomList::entries`,
and `Receiver<RoomInfoNotableUpdate>`. When a `RoomInfo` is
updated, a notable update is emitted and broadcasted. The
`RoomList` was filtering these notable updates by _reasons_ (namely
`RoomInfoNotableUpdateReasons`).

This is great and it's a good idea since we can filter which
`RoomInfoNotableUpdate` will trigger a `RoomList` update. However, too
many _reasons_ were hidden/implicit, and it creates several regressions
because (i) these _reasons_ were implicit, (ii) since the business rules
are not defined, there is no tests for that (not in this SDK, not in
apps like ElementX). It means we discover missing _reasons_ bug after
bug. It's not pleasant.

The reality is: we are in the middle of big changes, mostly with room
list client-side sorting and simplified sliding sync. We want to relax
a little bit. This patch then disable the feature _filter updates by
reasons_. The `RoomList` will update to all `RoomInfoNotableUpdate` for
the moment. We will get back to this optimisation later.
2024-07-18 16:29:45 +02:00
Damir Jelić 76a7052149 crypto: Fix UserIdentity::is_verified to take into account our own identity
The `UserIdentity::is_verified()` method in the matrix-sdk-crypto crate
before version 0.7.2 doesn't take into account the verification status
of the user's own identity while performing the check and may as a result
return a value contrary to what is implied by its name and documentation.

This patch fixes this and adds a regression test.

The method itself is not used internally and as such has not a larger
impact.

Co-authored-by: Denis Kasak <dkasak@termina.org.uk>
Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2024-07-18 16:20:47 +02:00
Ivan Enderlin 2aecf2950d fix(sdk): Add m.room.create to bump_event_types for sliding sync.
This patch updates the `rev` of our `ruma`'s fork to match the latest
commit of our `feat-sss` branch, see
https://github.com/ruma/ruma/commit/f25b3220d0c3ece7720020ed180af4955a855402.
It adds `m.room.create` in the `bump_event_types` of a
`v4::SyncRequestList` (equivalent of a `v5::request::List`).
2024-07-18 10:43:55 +02:00
Doug 4bbb6bd60c ffi: Don't add a custom SS proxy in ClientBuilder when using SSS. 2024-07-18 09:48:53 +02:00
Doug e37f65c46b ffi: Allow restoring an existing session with SSS enabled. 2024-07-18 09:48:53 +02:00
Doug 92b4c2a469 ffi: Expose client builder method to disable built in CAs. 2024-07-18 09:10:42 +02:00
Doug 20eb1db0f9 sdk: Allow building a Client with the built in CAs disabled. 2024-07-18 09:10:42 +02:00
Damir Jelić 30e95bf992 chore: Use a released version of vodozemac (#3721) 2024-07-17 18:07:39 +02:00
Ivan Enderlin dd20c37f35 doc(sdk): Fix some typos in the documentation. 2024-07-17 16:33:37 +02:00
Ivan Enderlin ea2a27075a feat(ffi,base,ui,sdk): Migrate from sliding sync to simplified sliding sync.
This patch migrates the entire SDK to sliding sync to simplified sliding
sync.
2024-07-17 16:33:37 +02:00
Ivan Enderlin c22de4c035 feat(sdk) Remove delta_token from sliding sync.
Simplified sliding sync doesn't have `delta_token`. This patch removes
it. Note: even the current sliding sync proxy doesn't use it.
2024-07-17 16:33:37 +02:00
Ivan Enderlin f84ce6a34f feat(sdk): Remove sort and bump_event_types from sliding sync.
Simplified sliding sync no longer has `sort` or `bump_event_types`
because they are static values on the implementation/server side. This
patch removes them here.
2024-07-17 16:33:37 +02:00
Ivan Enderlin 508176a2c7 feat(ui): Remove is_tombstoned filter from sliding sync.
Simplified sliding sync no longer has the `is_tombstoned` filter. This
patch removes it.
2024-07-17 16:33:37 +02:00
Ivan Enderlin dc9b975fc0 feat(base): Rename recency_timestamp to recency_stamp.
This patch renames “recency timestamp” to “recency stamp”. It prepares
the fact that simplified sliding sync has a `bump_stamp` instead of a
`timestamp`. The notion of _timestamp_ must be removed.
2024-07-17 16:33:37 +02:00
Ivan Enderlin ea9f79a006 feat(sdk): Remove SlidingSync::unsubscribe_from_room.
Simplified sliding sync no longer has the concept of unsubscribing from
a room. This patch removes this API.
2024-07-17 16:33:37 +02:00
Ivan Enderlin 1b92a034fd feat(sdk) Transform Simplified MSC3575 to MSC3575 in SlidingSync::sync_once.
This patch extracts most of `SlidingSync::sync_once` into a
method named `SlidingSync::send_sync_request`. The name mimics
the `SlidingSync::generate_sync_request` similar method: first we
_generate_, then we _send_.

The `SlidingSync::send_sync_request` is generic over the `Request` and
`::sync_once` passes the correct type depending of whether Simplified
MSC3575 is enabled.
2024-07-17 16:33:37 +02:00
Ivan Enderlin 5a4bf780fb feat(base): Create an http module for sliding_sync.
This patch creates an `http` module containing all the sliding sync types
types (from Simplified MSC3575 or simply MSC3575).
2024-07-17 16:33:37 +02:00
Ivan Enderlin c1a92bb3a9 chore(base): Move sliding_sync into its own module.
This patch moves the `sliding_sync` file into its own module.
2024-07-17 16:33:37 +02:00
Ivan Enderlin e3b950a9f0 feat(client): Add the Client::is_simplified_sliding_sync_enabled field.
This patch is the first over two patches to change the support
of Simplified MSC3575 from a compiler feature flag to a runtime
configuration. This configuration is held by the `Client`.
By default, it's turned off inside `matrix-sdk-ffi` and
`matrix-sdk-integration-testing`, otherwise it's turned on.
2024-07-17 16:33:37 +02:00
Kévin Commaille b79fdefbfd sdk-base: Split code into compute_summary and make less db requests
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-07-17 14:19:53 +02:00
Kévin Commaille e3ad875293 sdk-base: Use left and banned members as heroes as a last resort
As suggested in the spec.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-07-17 14:19:53 +02:00
Kévin Commaille 3f6df64386 sdk-base: Use invited members too when computing heroes locally
The spec is clear that heroes are joined and invited members.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-07-17 14:19:53 +02:00
Kévin Commaille 3bab1c3584 sdk-base: Do not treat left rooms differently than joined rooms
Otherwise they always show up as "Empty" when we don't have a room summary.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-07-17 14:19:53 +02:00
Marco Antonio Alvarez 897f1cfef1 matrix_sdk_base: make sticker events suitable as latest_event (#3715)
Currently on Element X if you receive a sticker in a room, the room list
will show the room as updated but it will show the latest event that is
not a sticker. This change fixes that.

Signed-off-by: 
Marco Antonio Alvarez <surakin@gmail.com>

---------

Signed-off-by: Marco Antonio Alvarez <surakin@gmail.com>
Signed-off-by: Benjamin Bouvier <public@benj.me>
Co-authored-by: Benjamin Bouvier <public@benj.me>
2024-07-17 13:09:48 +02:00
Kévin Commaille 1cc8292034 sdk: Allow to request animated thumbnails (#3710)
New feature from Matrix 1.11.

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

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-07-17 10:18:53 +00:00
Benjamin Bouvier d2c6a83175 sliding sync: only emit the recency_timestamp notable update if it's changed value 2024-07-17 10:32:49 +02:00
Benjamin Bouvier 91f8cfb48c integration tests: handle possibly limited timelines in test_stale_local_echo_time_abort_edit 2024-07-17 10:32:49 +02:00
Benjamin Bouvier 2fde15da79 integration tests: raise test_left_room join timeout a bit 2024-07-17 10:32:49 +02:00
Benjamin Bouvier 9d3fcb9290 room list: add logging explaining why we received an update 2024-07-17 10:32:49 +02:00
Benjamin Bouvier 171e4ef8f8 integration tests: make test_stale_local_echo_time_abort_edit resilient to more races 2024-07-17 10:32:49 +02:00
Benjamin Bouvier 55d0a3cdb8 integration tests: make test_event_with_context wait for as long as it claims
The previous linear backoff would retry overall 10 times the value, and
10x30 == 300ms, not 3 seconds.
2024-07-17 10:32:49 +02:00