Commit Graph

13080 Commits

Author SHA1 Message Date
Michael Goldenberg
c5097cf07e refactor(indexeddb): remove macros for implementing EventCacheStore
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-08-27 09:56:50 +02:00
Michael Goldenberg
b77c6c65cc feat(indexeddb): derive Clone for IndexeddbEventCacheStore
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-08-27 09:56:50 +02:00
Benjamin Bouvier
f4ce4356ab refactor(event cache): only process threaded linked chunks if thread support has been globally enabled matrix-sdk-ffi/20250826 2025-08-26 16:25:56 +02:00
Benjamin Bouvier
d66733052a feat(event cache): add indexes for finding related events 2025-08-26 16:25:56 +02:00
Benjamin Bouvier
001dadffe1 bench: add a benchmark for finding related events (#5578)
Does what it says on the tin. Split from the performance fix, so we can
get some initial numbers on the CI bench runs too.

Part of investigating
https://github.com/matrix-org/matrix-rust-sdk/issues/5572
2025-08-26 15:57:06 +02:00
Shrey Patel
b2387bf3a9 test(search): Add tests for RoomIndex::contains and indexing idempotency 2025-08-26 13:25:49 +02:00
Shrey Patel
d43858ecb2 fix(search): Make indexing idempotent 2025-08-26 13:25:49 +02:00
dependabot[bot]
8804966094 chore(deps): bump actions/setup-java from 4 to 5
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-26 10:04:28 +02:00
dependabot[bot]
a3ee011b61 chore(deps): bump crate-ci/typos from 1.35.4 to 1.35.5
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.35.4 to 1.35.5.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.35.4...v1.35.5)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.35.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-26 10:04:06 +02:00
dependabot[bot]
f586172f3e chore(deps): bump actions/upload-pages-artifact from 3 to 4
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-26 10:03:51 +02:00
Jorge Martín
85d52586b6 fix(media): Use the right Option<Duration> value to get no timeout 2025-08-25 13:50:53 +02:00
Benjamin Bouvier
40d3dd57db tests(threads): add an exhaustive test to check for all notification mode combinations 2025-08-25 10:09:55 +02:00
Skye Elliot
4e2655aa1b feat(sdk): Use clearer fields for Span in SendRawStateEvent 2025-08-22 14:27:05 +01:00
Skye Elliot
41fcebbcb0 chore(sdk): Move ensure_room_encryption_ready to end of file 2025-08-22 14:27:05 +01:00
Skye Elliot
13b86a3f5d tests: Add test_room_encrypted_state_event_send 2025-08-22 14:27:05 +01:00
Skye Elliot
dba23b66fa feat(sdk): Use SendStateEvent future in Room send_state methods
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-22 14:27:05 +01:00
Skye Elliot
132d0eb34a feat(sdk): Add SendStateEvent future
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-22 14:27:05 +01:00
Skye Elliot
e2e70448ca feat(sdk): Modify Room::send_state_event_raw to return SendRawStateEvent
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-22 14:27:05 +01:00
Skye Elliot
adaccbab2c feat(sdk): Add SendRawStateEvent future and deduplicate
Deduplicates common code that would be shared between
SendRawMessageLikeEvent and SendRawStateEvent to a helper method,
`ensure_room_encryption_ready`.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-22 14:27:05 +01:00
Richard van der Hoff
7a09ca0bbd Merge pull request #5545 from matrix-org/kaylendog/msc3414/json-castable
feat(sdk): Support room key downloading using `JsonCastable<EncryptedEvent>`
2025-08-21 18:59:23 +01:00
Richard van der Hoff
fffdd34ebd Merge pull request #5559 from matrix-org/kaylendog/encrypt-poll-sync
This fixes a small issue encountered while developing the integration test for encrypted state events. If the first sync response received from the server after enabling encryption does not contain the m.room.encryption event, the client will report the encryption state as unknown, even if the next sync response does contain the event.

 - [x] Modify Room::enable_encryption_inner to spin on the room encryption state, rather than bailing after the first sync response is received.

Signed-off-by: Skye Elliot
2025-08-21 17:07:22 +01:00
Skye Elliot
24502d2706 fix(sdk): Check correct encryption state for encrypted state events 2025-08-21 15:43:35 +01:00
dragonfly1033
b6433dea27 refactor(sdk): Move index handling to EventCache and use linked_chunk_update_sender.
Remove previous code that got updates in `RoomEventCacheState::post_process_new_events`.
Add new task in `EventCache` that subscribes to `linked_chunk_update_sender` and forwards new events to `client::search::SearchIndex` same as before.

Signed-off-by: Shrey Patel shreyp@element.io
2025-08-21 14:17:45 +00:00
dragonfly1033
385f1a824f feat(multiverse): Add search feature to multiverse 2025-08-21 14:50:11 +01:00
dragonfly1033
dfc0ef8b35 refactor(multiverse): Create generic PopupInput widget 2025-08-21 14:50:11 +01:00
Benjamin Bouvier
d2feeaac30 refactor(sdk): avoid an explicit dependency on ruma-common
The `ruma-common` crate is reexported by `ruma`, which is in our
dependency tree anyways. This change makes it so that qrcode, the only
crate that was making use of `ruma-common`, now depends on `ruma`. It
may move it further down the line in the compilation pipeline, but this
is unlikely to affect compile times in a crazy way. The benefit is that
this avoids the burden of having to specify the ruma commit hash twice
in the top-level Cargo.toml, as well as replacing it twice when
overriding it.
2025-08-21 15:42:25 +02:00
Benjamin Bouvier
25a81876a0 tests: allow conversion from EventBuilder into Raw<AnyGlobalAccountDataEvent>
This avoids a few explicit `.into_raw()` calls here and there.
2025-08-21 15:21:14 +02:00
Benjamin Bouvier
e388fe6522 tests: streamline the SyncResponseBuilder global account methods
Only keep two: the one that uses the output of the event factory, and
one using custom JSON data.
2025-08-21 15:21:14 +02:00
Benjamin Bouvier
ef20342ddf tests: use the new global account data methods a bit more 2025-08-21 15:21:14 +02:00
Benjamin Bouvier
e6b1ffba99 tests: add support for the global account PushRules event in the event factory 2025-08-21 15:21:14 +02:00
Benjamin Bouvier
9a3ceb8be6 tests: add support for the global account IgnoredUserList event in the event factory 2025-08-21 15:21:14 +02:00
Benjamin Bouvier
faee647c3a tests: get rid of GlobalAccountDataTestEvent::Direct 2025-08-21 15:21:14 +02:00
Benjamin Bouvier
1866143456 tests: add support for the global account Direct event in the event factory 2025-08-21 15:21:14 +02:00
Benjamin Bouvier
be8e322ad6 doc(sdk): add comments around the NotificationSettings data structure 2025-08-21 15:21:14 +02:00
Benjamin Bouvier
838f607b32 refactor(benchmark): slightly change the benchmark to make it not use iter_custom
Instead of creating a fresh client every single time, this creates a
single client with a single event cache store, that's cleared between
runs of the benchmark.

So the tradeoff is:
- we don't have to create a new client anymore, which means no more
async setup code, which means we can avoid using `iter_custom`; a
benefit of this is that this can be benchmarked on CI now.
- but we're also measuring the time it takes to clear the database,
which isn't trivial in itself.
2025-08-21 15:19:26 +02:00
Benjamin Bouvier
6965004812 fix(benchmark): make the event cache benchmark compute what it's supposed to 2025-08-21 15:19:26 +02:00
Benjamin Bouvier
8ec23a95d5 fix(event cache): avoid cycle of EventCacheInner with the auto_shrink_linked_chunk_task
The task would stop when the receiver is closed; for the receiver to be
closed, the sender ought to be closed too.

Because the sender lives in `EventCacheInner`, and the task would hold
onto an `EventCacheInner` struct, the sender would never be dropped, so
the full `EventCacheInner` would leak, as a result.
2025-08-21 15:19:26 +02:00
Skye Elliot
7880ec5b01 fix(sdk): Return from poll when encryption state known
Fixes Room::enable_encryption_inner to break out of polling the
encryption state when it becomes known, rather than just encrypted.
2025-08-20 13:56:05 +01:00
Skye Elliot
36428564fc feat(sdk): Poll encryption state on sync event for up to 3 seconds. 2025-08-20 12:45:04 +01:00
Skye Elliot
7adaf7be73 feat(sdk): Rename state encryption methods for improved clarity
Changes `Room::enable_encryption_with_state` to
`Room::enable_encryption_with_encrypted_state_events`, and updates the
respective unit test and testing utilities.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-20 12:28:03 +02:00
Skye Elliot
7920723bb4 docs(sdk): Update CHANGELOG.md
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-20 12:28:03 +02:00
Skye Elliot
b73163aa45 feat(sdk): Add Room::enable_encryption_with_state
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-20 12:28:03 +02:00
Ivan Enderlin
feeeb53f19 refactor(sdk): Simplify Client::(joined|invited|left)_rooms.
This patch updates `Client::joined_rooms`, `invited_rooms` and
`left_rooms` to re-use `Client::rooms_filtered`.
2025-08-20 11:27:03 +02:00
Ivan Enderlin
1ac876db98 doc(sdk): Rephrase a couple of comments. 2025-08-20 08:37:27 +02:00
Ivan Enderlin
afaf2cc036 test(sdk): Test that local latest event values has priority over remote's.
This patch moves the `test_update_ignores_none_value`
test in a new (correct) test module, and creates the new
`test_local_has_priority_over_remote` test.
2025-08-20 08:37:27 +02:00
Ivan Enderlin
5a3bb0a86d feat(sdk): Ensure the send queue has the priority over the event cache for computing a LatestEventValue. 2025-08-20 08:37:27 +02:00
Ivan Enderlin
2640aa1e23 fix(sdk): Compute the LatestEventValue on SentEvent before removing it from the buffer.
This patch changes the order in which the `LatestEventValue` is removed
from the buffer and re-created in case of a `SentEvent`. Previously,
the value from the buffer was removed before re-creating one, now it's
the opposite.

Why this order? Because once the local event is sent, it's not yet
received by the sync and consequently not stored in the event cache. So
once the local event is sent, it won't show up as a `LatestEventValue`
as it will immediately be replaced by an event from the event cache. By
computing the new value before removing it from the buffer, we ensure
the `LatestEventValue` represents the just sent local event.

See the comment in the code to learn more.
2025-08-20 08:37:27 +02:00
Ivan Enderlin
d1a8392ce7 refactor(sdk): Rename LocalIsWedged to LocalCannotBeSent.
This patch renames `LocalIsWedged` to `LocalCannotBeSent` to avoid
confusion with the wedged/unwedged state of the `send_queue`. The
semantics is different in `latest_events`.
2025-08-19 16:35:41 +02:00
Ivan Enderlin
4d14dd3692 doc(sdk): Add a TODO marker for later. 2025-08-19 16:35:41 +02:00
Ivan Enderlin
63defca8af chore(sdk): Add mark_ prefix. 2025-08-19 16:35:41 +02:00