Commit Graph

13223 Commits

Author SHA1 Message Date
Benjamin Bouvier
df65c94974 chore(ui): apply review comments 2025-06-09 16:59:32 +02:00
Stefan Ceriu
39ee5112b4 chore(ui): add timeline threaded filtering tests 2025-06-09 16:59:32 +02:00
Stefan Ceriu
96afdeffad feat(ui): add TimelineFocus associated values for defining whether threaded events should be hidden on those particular timeline instances. 2025-06-09 16:59:32 +02:00
Stefan Ceriu
669d91e7e9 feat(ui): add thread based filtering for local event items 2025-06-09 16:59:32 +02:00
Stefan Ceriu
dcec53ba00 feat(ui): filter threaded remote events based on the timeline focus and extracted relations 2025-06-09 16:59:32 +02:00
Stefan Ceriu
9d9ce4a68b chore(ui): remove relation processing when dealing with EmbeddedEvents 2025-06-09 16:59:32 +02:00
Stefan Ceriu
dc24365ddf chore(ui): move event based relation handling to TimelineMetadata and out of the TimelineAction 2025-06-09 16:59:32 +02:00
Stefan Ceriu
ba53390547 chore(ui): move timeline item relation handling from the TimelineAction to the TimelineMetadata 2025-06-09 16:59:32 +02:00
Stefan Ceriu
c860e7fca7 fix(ui): load up reactions to threaded messages 2025-06-09 16:59:32 +02:00
Benjamin Bouvier
ebcb74a86d refactor!(event cache): introduce LinkedChunkId in the backends (#5182)
In a "soon" future, threads have their own linked chunk. All our code
has been written with the fact that a linked chunk belong to *a room* in
mind, so it needs some biggish update. Fortunately, most of the changes
are mechanical, so they should be rather easy to review.

Part of #4869, namely #5122.
2025-06-09 13:26:46 +00:00
Jonas Platte
65bb20c965 refactor: Clean up tracing and formatting macro uses (#5192)
Signed-off-by: Jonas Platte <jplatte+matrix@posteo.de>
2025-06-09 12:15:59 +02:00
VerdeQuar
bdda4abf56 fix(crypto): Remove wildcard enum variant import
Signed-off-by: VerdeQuar <verdequar@gmail.com>
2025-06-07 14:55:27 +02:00
Jorge Martín
47e81818bc test: Add extra test for the active call state
Also, adapt the other tests to the new return type
2025-06-06 15:02:17 +02:00
Jorge Martín
fe015b7eda refactor: Expose the new return type of Client::send_call_notifications_if_needed in the FFI layer 2025-06-06 15:02:17 +02:00
Jorge Martín
baf6824bc4 refactor: Add extra logs to Client::send_call_notifications_if_needed
Also make it return `Result<bool>` instead of `Result<()>` so we can check if the event was sent.
2025-06-06 15:02:17 +02:00
Jorge Martín
c1ce92bf48 refactor(ffi): Use Client::room_info_notable_update_receiver instead of RoomUpdates
This allows us to also react to local changes that would take several extra seconds to be received in a new sync response.
2025-06-06 13:18:49 +02:00
Benjamin Bouvier
4eb7e0c845 feat(timeline): insert the timeline start item just after creating a live timeline
This is even better, as we don't need to look at the live pagination
status to know whether we've reached the start of the timeline or not.
2025-06-06 12:57:39 +02:00
Benjamin Bouvier
766ff3f8e9 test(timeline): add a test for the mysterious missing timeline start case 2025-06-06 12:57:39 +02:00
Benjamin Bouvier
a855f1df2c fix(timeline): add the timeline start of the current pagination state too 2025-06-06 12:57:39 +02:00
Ivan Enderlin
0478037b57 fix(base): Revisit check_tombstone entirely.
This patch renames `check_tombstone` to `check_room_upgrades`.
Then it rewrites it **entirely** to remove all false-positives and
false-negatives. More importantly, the room versions are no longer
involved: they can't be compared or ordered, they must be treated as
opaque values.

This new version of `check_room_upgrades` does a first path to check
predecessor-successor consistency. Then it does a second version to
detect loops. This new algorithm is robust to absent `m.room.create`
events. Making them mandatory is left to another patch.

More tests are added, especially to ensure that `m.room.create` cannot
be overwritten, and to ensure loops or inconsistent predecessors and
successors are correctly detected.
2025-06-06 12:54:45 +02:00
Benjamin Bouvier
caa07a8007 refactor(sdk): regroup bundled thread extraction in TimelineEvent ctors 2025-06-06 13:34:12 +03:00
Benjamin Bouvier
93f2c61447 feat(event cache): store a bundled thread's latest TimelineEvent if provided 2025-06-06 13:34:12 +03:00
Benjamin Bouvier
c8a5c43232 feat(common): temporarily store a bundled thread's latest TimelineEvent 2025-06-06 13:34:12 +03:00
Benjamin Bouvier
2aeb1a0353 refactor(sdk): rename TimelineEvent::new to from_plaintext 2025-06-06 13:34:12 +03:00
Benjamin Bouvier
a1ad772642 refactor(sdk): rename TimelineEvent::new_utd_event to from_utd 2025-06-06 13:34:12 +03:00
Benjamin Bouvier
b8f850b6f2 refactor(sdk): make it clearer that Context isn't mutated in a few processor helpers
It isn't mutated by the function, so there's no need to pass a mutable
reference here.
2025-06-06 13:34:12 +03:00
Benjamin Bouvier
c6ed2d1963 refactor(sdk): compute push actions before creating a decrypted TimelineEvent
This reduces the number of callers to `set_push_actions()`, which should
be minimally used.
2025-06-06 13:34:12 +03:00
Benjamin Bouvier
c48a2d68d1 refactor(base): streamline the verification processor 2025-06-06 13:34:12 +03:00
Benjamin Bouvier
5a1909aab9 refactor(sdk): get rid of the implicit conversion from DecryptedEvent to TimelineEvent 2025-06-06 13:34:12 +03:00
Benjamin Bouvier
fc81178504 refactor(sdk): make TimelineEvent::push_actions private
And add getters and setters. It makes it clear who are the external
readers/writers of the push actions, and it makes it impossible to
create a `TimelineEvent` out of thin air (since it now has a private
field).
2025-06-06 13:34:12 +03:00
Daniel Salinas
d3f63e91d5 Enable subscribe_to_send_progress for Wasm 2025-06-06 10:08:04 +02:00
Benjamin Bouvier
70705f4e9d chore(ci): exclude some crate from codecov testing
There's been many segfaults happening in tests, while running the test
coverage for this specific crate. An issue has been opened on
cargo-tarpaulin's repository:

https://github.com/xd009642/tarpaulin/issues/1749

Until this is fixed or worked around, we'll disable coverage testing for
this specific crate.
2025-06-06 09:28:55 +02:00
Benjamin Bouvier
8c66e0ba2f chore(ci): remove unused SLIDING_SYNC_PROXY_URL env variable 2025-06-06 09:28:55 +02:00
Benjamin Bouvier
f5e0c6f004 chore(ci): exclude multiverse from the codecov reports 2025-06-06 09:28:55 +02:00
Jonas Platte
2a140770a0 fix: Move runtime module from matrix-sdk-common to matrix-sdk-ffi (#5184)
This module only builds on non-wasm with the patched async-compat from
the workspace Cargo.toml's patch section, and it is only used by the ffi
crate. It is currently breaking the use of the SDK as a git dependency,
and would prevent the publishing of matrix-sdk-common (unless using
--no-verify, but then that would just break all users of the newly
published crates.io version).

This bug was introduced in
https://github.com/matrix-org/matrix-rust-sdk/pull/5089.

Signed-off-by: Jonas Platte <jplatte+matrix@posteo.de>
2025-06-05 19:30:15 +00:00
Jorge Martín
becbb63ad7 feat(ffi): Subscribe to a room's RoomInfo through Client
This helps in the case we want to observe the membership state changes - or some other info - for a room that's still not known so we can't just use `Client::get_room` to fetch it.
2025-06-05 16:49:39 +02:00
Damir Jelić
34d3cd496b feat(multiverse): Show thread roots even if we can't find the latest message 2025-06-05 16:29:54 +02:00
Damir Jelić
1f9c3394c5 refactor(multiverse): Split out the timeline item formatting logic 2025-06-05 16:29:54 +02:00
Damir Jelić
005f002747 feat(multiverse): Start to render threads 2025-06-05 16:29:54 +02:00
Damir Jelić
80b8a6d8cc feat(multiverse): Allow timeline items to be selected 2025-06-05 16:29:54 +02:00
Valere
f7265c39e0 cleanup: Reuse existing server.mock_sync instead of custom function 2025-06-05 14:29:50 +02:00
Valere
4468c36b14 review: extend existing MatrixMockServer instead of creating another 2025-06-05 14:29:50 +02:00
Valere
25841c787e refactor(test): Extract common crypto mock server helper 2025-06-05 14:29:50 +02:00
Damir Jelić
9461ef3a5a chore: Fix a typo in the cargo-deny file 2025-06-05 11:11:40 +02:00
Johannes Marbach
b8ae210e4a feat(ffi): Add reply_params to GalleryUploadParameters (#5173)
Looks like I forgot adding this in
https://github.com/matrix-org/matrix-rust-sdk/pull/5163, sorry.
Everything below the FFI layer was already prepared for replies.

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-06-05 10:07:32 +01:00
Daniel Salinas
a3225e5cd7 feat(wasm): Wasm equivalent of get_runtime_handle and corresponding tokio types (#5089)
Adds a Wasm equivalent of the get_runtime_handle method provided by
tokio, as well as Handle/Runtime types that can be used on either Wasm
or non-Wasm platforms interchangeably.

Dependent on https://github.com/matrix-org/matrix-rust-sdk/pull/5088
<!-- description of the changes in this PR -->

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

<!-- Sign-off, if not part of the commits -->
<!-- See CONTRIBUTING.md if you don't know what this is -->
Signed-off-by: Daniel Salinas

---------

Signed-off-by: Daniel Salinas <zzorba@users.noreply.github.com>
Co-authored-by: Daniel Salinas <danielsalinas@Daniels-MacBook-Pro-2.local>
Co-authored-by: Daniel Salinas <danielsalinas@daniels-mbp-2.myfiosgateway.com>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2025-06-05 08:07:01 +02:00
Daniel Salinas
0777e6e08a feat(wasm): Enable subscribe_to_send_progress on wasm platforms (#5170) 2025-06-04 18:13:47 +02:00
Daniel Salinas
8b2088fd61 feat(wasm): Eliminate some unecessary wasm removals from matrix-sdk crate (#5169) 2025-06-04 18:13:27 +02:00
Johannes Marbach
d38f409351 feat(ffi): Expose method for sending galleries (#5163)
Addendum to https://github.com/matrix-org/matrix-rust-sdk/pull/5125 to
allow sending galleries from the FFI crate. This is the final PR for
galleries (apart from possible enhancements to report the upload status
in https://github.com/matrix-org/matrix-rust-sdk/pull/5008).

This is somewhat lengthy again, apologies. Most of the changes are just
wrappers and type mapping, however. So I was hoping that it's relatively
straightforward to review in bulk. Happy to try and elaborate on the
changes or break them up into smaller commits if that helps, however.

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-06-04 16:41:03 +02:00
Daniel Salinas
58b8a2560c feat(wasm): Comprehensive Send+Sync bound improvements for Wasm compatibility (#5082)
This commit systematically replaces Send+Sync trait bounds throughout
the matrix-rust-sdk codebase to enable Wasm compatibility while
maintaining thread safety on native targets.

Key changes:
- Use SendOutsideWasm/SyncOutsideWasm traits instead of Send/Sync for
trait bounds
- Apply conditional compilation for error types and trait objects
- Update FFI trait definitions to use Wasm-compatible bounds
- Fix event handler and type alias definitions for cross-platform
compatibility
- Maintain existing functionality while enabling WebAssembly target
support

The SendOutsideWasm/SyncOutsideWasm traits are empty on Wasm (allowing
all types) and alias to Send/Sync on native targets, ensuring zero-cost
abstraction.

Files updated:
- All FFI bindings (30+ trait definitions)
- Core SDK error types and type aliases
- Event handler infrastructure
- Store and crypto abstractions
- UI service filters and sorters
- Timeline and authentication modules

<!-- description of the changes in this PR -->

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

<!-- Sign-off, if not part of the commits -->
<!-- See CONTRIBUTING.md if you don't know what this is -->
Signed-off-by: Daniel Salinas

---------

Signed-off-by: Daniel Salinas <zzorba@users.noreply.github.com>
Co-authored-by: Daniel Salinas <danielsalinas@Daniels-MacBook-Pro-2.local>
Co-authored-by: Daniel Salinas <danielsalinas@daniels-mbp-2.myfiosgateway.com>
2025-06-04 15:59:37 +02:00