Commit Graph

12217 Commits

Author SHA1 Message Date
Benjamin Bouvier
fe11fda832 refactor(timeline): extract the method to fetch a latest thread reply as an item
Do the ~~~loco~~ code motion 🎶
2025-06-03 16:28:25 +02:00
Benjamin Bouvier
281faa7a0b refactor(ffi): simplify From<TimelineDetails<Profile>> for ProfileDetails 2025-06-03 16:28:25 +02:00
Benjamin Bouvier
7962253ebd refactor(timeline): only use the publicly exposed content/sender/sender_profile on EmbeddedEvent 2025-06-03 16:28:25 +02:00
Benjamin Bouvier
dd14df086e refactor(ffi): simplify FFI layer and use only EmbeddedEventDetails there for both thread latest event + replied-to event item 2025-06-03 16:28:25 +02:00
Benjamin Bouvier
c426138971 refactor(timeline): rename RepliedToEvent to EmbeddedEvent and reuse it for the thread summary 2025-06-03 16:28:25 +02:00
Benjamin Bouvier
ff4b7a8acc feat(event cache): add basic support for the latest event in the thread summary 2025-06-03 16:28:25 +02:00
Benjamin Bouvier
a152f9c074 refactor(event cache): remove one caller of with_events_mut
The actual code useful in `with_events_mut` and used in that function
was to propagate the changes to the store and propagating diffs to
observers. It often striked me as hacky to use this method to do that,
so instead I'm proposing here to inline the useful bits. That way,
`with_events_mut` is now clearly called only in two cases: after a sync,
or after a successful network back-pagination.
2025-06-03 16:28:25 +02:00
Benjamin Bouvier
50be8a158c refactor(event cache): only send a thread summary update when a thread has changed 2025-06-03 16:28:25 +02:00
Benjamin Bouvier
aa291079d0 feat(event cache): include the reply count in the ThreadSummary 2025-06-03 16:28:25 +02:00
Benjamin Bouvier
672bb9f460 feat: add the busy timeout pragma to the event cache store acquire() method too
It will tell us if this is sufficient to avoid locking the event cache
store database, now that we have some proof that this is happening in
the wild.
2025-06-03 16:17:36 +02:00
Kévin Commaille
9a75007535 Upgrade Ruma
Use the newly released version.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-06-03 15:52:15 +02:00
Johannes Marbach
ee06965d2e feat(timeline): Expose method to send galleries in matrix-sdk-ui (#5125)
This was broken out of
https://github.com/matrix-org/matrix-rust-sdk/pull/4838 and is a step
towards implementing
https://github.com/matrix-org/matrix-spec-proposals/pull/4274. Building
upon https://github.com/matrix-org/matrix-rust-sdk/pull/4977, a new
method `Timeline::send_gallery` in matrix-sdk-ui for sending galleries.

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

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-06-03 15:24:02 +02:00
Ivan Enderlin
8e3ad22d92 doc(base): Improve documentation.
This patch improves an inline documentation.

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
Signed-off-by: Ivan Enderlin <ivan@mnt.io>
2025-06-03 15:04:26 +02:00
Ivan Enderlin
c7f6190cff feat(base): Detecting invalid states in room upgrades.
This patch adds the `check_tombstone` response processor to
detect invalid state with room upgrades. One can check the new
`InconsistentTombstonedRooms` error to learn more about the detected
patterns.
2025-06-03 15:04:26 +02:00
Ivan Enderlin
5ccb1c6fa8 fix(base): Fix the Debug implementation of RoomUpdates.
The field of `RoomUpdates` has been renamed, but the `Debug`
implementation does not reflect that change. This patch fixes that.
2025-06-03 15:04:26 +02:00
Ivan Enderlin
b77a02662d feat(base): Add RoomUpdates::iter_all_room_ids.
This patch adds the `RoomUpdates::iter_all_room_ids` method, to iterate
over all IDs of rooms that have received an update.
2025-06-03 15:04:26 +02:00
Damir Jelić
13306be4ed fix(multiverse): Wait for the join task to finish before switching the view 2025-06-03 14:07:37 +02:00
Yousef Moazzam
491f81c376 test: remove unnecessary image info field values 2025-06-03 13:19:34 +02:00
Yousef Moazzam
703c01004c test: remove unnecessary server timestamp field on sticker event 2025-06-03 13:19:34 +02:00
Yousef Moazzam
b1d34763d4 test: create timeline event with EventBuilder method 2025-06-03 13:19:34 +02:00
Yousef Moazzam
c4aa200f19 test: create sticker event with EventFactory 2025-06-03 13:19:34 +02:00
Yousef Moazzam
a099879563 test: add reply thread relation method to sticker event builder 2025-06-03 13:19:34 +02:00
Yousef Moazzam
b6569762db test: add sticker event method to EventFactory 2025-06-03 13:19:34 +02:00
Jorge Martín
edabb2362b refactor: revert some method removals in SendRequest 2025-06-03 12:59:00 +02:00
Jorge Martín
8a5d4f0d82 test: Increase delay to fix code coverage failure 2025-06-03 12:59:00 +02:00
Jorge Martín
12aed8dc67 test: fix tests after adding the media config check 2025-06-03 12:59:00 +02:00
Jorge Martín
7d03d4ce0d feat(ffi): Add Client::get_max_media_upload_size function
This allows the clients to know the max upload size for a media file and try to compress if it's too large for the homeserver.
2025-06-03 12:59:00 +02:00
Jorge Martín
2680dc65fd fix(sdk): check max_upload_size before attempting to upload any media 2025-06-03 12:59:00 +02:00
Richard van der Hoff
a1e2eed467 sdk: Add ClientBuilder::with_enable_share_history_on_invite (#5141)
Replace `experimental-share-history-on-invite` feature flag with a
runtime flag on the `Client`.
2025-06-03 11:36:48 +01:00
Benjamin Bouvier
5600ce7a77 fix(event cache): after adding a thread summary in memory, also save the result in the store 2025-06-03 12:22:21 +02:00
Benjamin Bouvier
f28a2b1cc3 fix(event cache): after redacting an in-memory event, also save the result in the store 2025-06-03 12:22:21 +02:00
Benjamin Bouvier
1a07ec22b8 test(event cache): move tests which require the cross process lock under a different test mod
This avoids a few `use` statements within the test functions themselves,
and helps finding out which tests are integration tests.
2025-06-03 12:22:21 +02:00
dependabot[bot]
7b8671d82c chore(deps): bump tj-actions/changed-files
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from c6634ca281a9fc05b03bee224ba00910cb78ab6e to 115870536a85eaf050e369291c7895748ff12aea.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](c6634ca281...115870536a)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: 115870536a85eaf050e369291c7895748ff12aea
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-03 11:17:12 +02:00
Daniel Salinas
0f877a3e80 feat(wasm): Replace async_trait with wasm aware cfg conditional 2025-06-02 23:07:05 +02:00
Daniel Salinas
c6e55c1a36 Mechanical move from target_arch="wasm32" to target_family="wasm" 2025-06-02 17:27:34 +02:00
Benjamin Bouvier
40648f6998 chore: formatting, clippy and review comments 2025-06-02 16:24:25 +02:00
Benjamin Bouvier
58b46813d6 feat(event cache): when we see a thread reply, add a thread summary to the thread root 2025-06-02 16:24:25 +02:00
Benjamin Bouvier
f2a90cb921 test: use helpers to create a bundled edit and thread summary 2025-06-02 16:24:25 +02:00
Benjamin Bouvier
efda26ef6f feat(timeline): forward the TimelineEvent::thread_summary to timeline items
Right now, we're not passing the latest event yet, but we could improve
that later!
2025-06-02 16:24:25 +02:00
Benjamin Bouvier
433209ca9b feat(common): always extract a bundled thread summary when creating or deserializing a timeline event 2025-06-02 16:24:25 +02:00
Benjamin Bouvier
1680891982 feat(common): add helper to extract a bundled thread summary 2025-06-02 16:24:25 +02:00
Benjamin Bouvier
3c965ed56e feat(common): add a ThreadSummary field to TimelineEvent
It can be either known to be there or not there, or in an unknown state,
hence a tiny enum making this very explicit.
2025-06-02 16:24:25 +02:00
Benjamin Bouvier
0bb2c44254 feat(common): don't serialize push actions if there's none
If the vec of actions is defined (Some) but empty, then it means we
could determine there are no push actions. It is a slight optimization
to not serialize them, in this case; otherwise, this can result in many
serialized empty action vector, in the event cache's persistent storage.
2025-06-02 16:24:25 +02:00
Benjamin Bouvier
23cdcaf5c8 feat(common): add helpers to extract only the thread root from a raw event 2025-06-02 16:24:25 +02:00
Benjamin Bouvier
ebc7396334 refactor(sdk): remove unused TimelineEvent ctor
It was intended for test purposes, but it seems it's unused, so let's
get rid of it.
2025-06-02 16:24:25 +02:00
Benjamin Bouvier
c7234b6f13 doc: make the self type clearer in doc comment of TimelineEvent 2025-06-02 16:24:25 +02:00
Richard van der Hoff
56be9dec59 multiverse: expand user names when inviting (#5146)
When the user does an `/invite`, if the target user doesn't start with
an `@`, try expanding it as a user on the local server.

This makes it much easier when repeatedly testing inviting!
2025-06-02 14:41:20 +01:00
Richard van der Hoff
2fa6a98052 multiverse: write logs to session dir (#5145)
Rather than always writing the logs to `/tmp`, write them to the session
directory. The session directory defaults to `/tmp` so by default this
will do the same as before, but if you override the session path on the
commandline, the logs will get stored alongside the stores and caches.

This is particularly useful when running two instances of multiverse,
and you want them to put their logs in different places.
2025-06-02 14:41:11 +01:00
Yousef Moazzam
f03407fdb9 test: remove unnecessary server timestamp fields on events 2025-06-02 14:59:23 +02:00
Yousef Moazzam
fd4fd3c4f9 test: add timeline events in bulk to room builder 2025-06-02 14:59:23 +02:00