Commit Graph

15173 Commits

Author SHA1 Message Date
Ivan Enderlin
94716fd231 chore(sdk): Improve an inline comment. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
cead90253e feat(sdk): Add LinkedChunk::first_chunk.
This patch adds `LinkedChunk::first_chunk`, and exposes it to
`EventLinkedChunk` to replace the use of 2 iterators in `RoomPagination`
and `ThreadPagination`, and to remove 2 `unwrap`s.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
5e3b98e714 chore(sdk): Remove the TODO from the documentation. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
94429c982e test(sdk): Add test_reload_when_dirty for thread. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
0b0f22298f fix(sdk): Reload all the “inner states” of a RoomEventCache at once.
`RoomEventCache` holds the states for the room cache, the thread caches,
and the pinned-events cache. When the cross-process lock is dirty, it
has to reload all these caches.

Ideally, we must move all the states in a single struct, behind the
cross-process lock, because right now, when the lock is dirty, only a
single room is reloaded, not all the rooms. This is a temporary fix.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
b08b9e4002 test(sdk): Add test_load_from_storage_resilient_to_failure for thread. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
a1706a2243 test(sdk): Add test_load_from_storage for thread. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
839825dd9a feat(sdk): Emit a RoomEventCacheGenericUpdate when the ThreadEventCache is built.
This patch updates `ThreadEventCache::new` to emit a
`RoomEventCacheGenericUpdate` when it's built, similarly to
`RoomEventCache`. This is important for external API, like Latest Event.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
c9e66af4f4 test(sdk): Add test_clear for thread. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
b0c544d6e3 feat(sdk): ThreadEventCacheUpdateSender can send RoomEventCacheGenericUpdate.
This patch updates `ThreadEventCacheUpdateSender` to send
`RoomEventCacheGenericUpdate`. This is useful for `ThreadPagination`.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
91d5b452c7 doc(sdk): Remove an address TODO. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
4a3420318b test(sdk): Add test_write_to_storage_strips_bundled_relations for thread. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
776129c4a8 test(sdk): Add test_write_to_storage in thread. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
d57434cd93 test(sdk): Simplify room::timed_tests::test_write_to_storage.
No need to deserialise the messages. We can assert the event ID
directly.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
55b51a3744 chore(sdk): Make Clippy happy. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
f3ba0c9082 feat(sdk): A redacted event in a thread is no longer removed: it's updated.
This patch fixes an invalid behaviour in a thread: when an in-thread
event was redacted, it was removed from the thread. This is inconsistent
regarding in-room event redaction where a redacted event is updated to
its redacted form and the redaction event is added to the timeline. This
patch makes the behaviour consistent by updating the redacted event.

Basically, it replaces `remove_if_present` (deleted) by
`replace_event_if_present` (new).
2026-04-28 11:50:07 +02:00
Ivan Enderlin
0d24434ea4 test(sdk): Use a previously declared event.
This patch replaces the construction of an event by its equivalent in a
variable. The test uses `first_event` and `second_event`, but builds the
“`second_event`” manually for no reason, it's just confusing
2026-04-28 11:50:07 +02:00
Ivan Enderlin
7e4008d1af test(sdk): Rename test_thread_can_paginate_even_if_seen_sync_event.
This patch renames the `test_thread_can_paginate_evn_if_seen_sync_event`
to `test_thread_contains_its_root_event`. It is what it tests.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
b19ac78c4a test(sdk): Remove test_gappy_sync_empties_all_threads. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
253481a0d3 feat(sdk): Insert gaps in threads.
This patch stops erasing threads when a gap is encountered. Instead, it
will insert gaps as we do for rooms.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
f9d09d9a93 chore(sdk): Pass the prev-batch token from the sync up to the ThreadEventCacheStateLockWriteGuard.
This patch passes the `prev_batch_token` up to
`ThreadEventCacheStateLockWriteGuard::handle_sync`.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
073d3abe59 feat(sdk): Paginate over the store for threads.
This patch adds the ability to paginate in the store for
`ThreadPagination`.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
26f5d21142 feat(sdk): Create ThreadEventCacheUpdateSender.
This patch creates the `ThreadEventCacheUpdateSender` à la
`RoomEventCacheUpdateSender` to abstract the sender.

This patch uses `ThreadEventCacheUpdateSender` in
`ThreadEventCacheInner` (new) along with `ThreadEventCacheState`. The
use in the `ThreadEventCacheInner` type is necessary to be able to send
updates without reaching the state (which is behind an async faillible
lock). This is necessary for pagination, see next commit.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
05270cb579 chore(sdk): Make more RoomEventCacheInner fields private.
This patch makes `RoomEventCacheInner::weak_room`, `state`,
`pagination_batch_token_notifier`, and `shared_pagination_status`
private.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
d75f2625ba chore(sdk): Use use self:: to import from self.
This patch forces to use of `use self::s` instead of `use s` to make it
clear it comes from `self`. It clarifies the code here.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
898334f6f3 doc(sdk): Fix a comment. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
7265953d47 doc(sdk): Update an inline comment. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
5a106baf14 chore(sdk): Add a #[must_use] to `ThreadEventCacheStateLockWriteGuard::handle_sync. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
9cbc65b732 chore(sdk): Add a trace! log in `ThreadEventCacheStateLockWriteGuard::handle_sync. 2026-04-28 11:50:07 +02:00
Ivan Enderlin
40a92a9994 feat(sdk): Use the in-memory and in-store deduplicator.
This patch replaces
`ThreadEventCacheStateLockWriteGuard::filter_duplicate_events` by
`deduplicator::filter_duplicate_events`. First off, this function is
shared between multiple event caches. Second, it deduplicates events
regarding in-memory and in-store state.

The calls to `ThreadEventCacheStateLockWriteGuard::remove_events` have
been updated to pass the duplicated in-store events.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
4579918d1f chore(sdk): Simplify code in RoomPagination.
This patch simply inlines a variable definition to simplify the code.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
09503d1de0 feat(sdk): Support removing events from the store for ThreadEventCache.
This patch updates `ThreadEventCacheStateLockWriteGuard::remove_events`
to also remove events from the store (it was only removing events from
the in-memory LinkedChunk prior to this patch).
2026-04-28 11:50:07 +02:00
Ivan Enderlin
e82ae7c840 feat(sdk): Shrink to last chunk when ThreadEventCacheState is reloaded.
This patch updates the `reload` method on the
`ThreadEventCacheStateLockWriteGuard` to shrink to the last chunk from
the store.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
c76c08fbf2 feat(sdk): Load the last chunk from the store for ThreadEventCache.
This patch loads the LinkedChunk metadata, in addition to lazy load the
last chunk of the `ThreadEventCache`.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
65da892731 chore(sdk): Move load_linked_chunk_metadata inside persistence.
This patch moves the `load_linked_chunk_metadata` function from
`event_cache::caches::room::state` to `event_cache::persistence`. It's
going to be useful for `ThreadEventCache`.
2026-04-28 11:50:07 +02:00
Ivan Enderlin
232cae9cf3 feat(sdk): Check if the EventCacheStoreLock is dirty in LockedThreadEventCacheState.
This patch checks if the `EventCacheStoreLock` is dirty when
constructing `LockedThreadEventCacheState`. This patch is the first
step, but it involved a bit of refactoring since `new` is now fallible
and async. It propagates up to the public API which were already
fallible and async fortunately for us: no breaking change.

This patch changes `get_or_reload` to not clone the room ID, the store
etc. every time, but rather only when the `ThreadEventCache` must be
created.
2026-04-28 11:50:07 +02:00
Kévin Commaille
6777907f28 Upgrade Ruma
Use the new release.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-04-28 10:45:22 +03:00
dependabot[bot]
f2bdb7c8b7 chore(deps): bump taiki-e/install-action from 2.75.10 to 2.75.18
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.75.10 to 2.75.18.
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](85b24a67ef...055f5df8c3)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.75.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 09:44:21 +02:00
dependabot[bot]
77baf25b4b chore(deps): bump tj-actions/changed-files from 47.0.5 to 47.0.6
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 47.0.5 to 47.0.6.
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](22103cc46b...9426d40962)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: 47.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 09:31:36 +02:00
dependabot[bot]
84d2e61190 chore(deps): bump zizmorcore/zizmor-action from 0.5.2 to 0.5.3
Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.2 to 0.5.3.
- [Commits](71321a20a9...b1d7e1fb5d)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 09:30:42 +02:00
dependabot[bot]
5c17acd75e chore(deps): bump EmbarkStudios/cargo-deny-action from 2.0.15 to 2.0.17
Bumps [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action) from 2.0.15 to 2.0.17.
- [Commits](3fd3802e88...91bf2b620e)

---
updated-dependencies:
- dependency-name: EmbarkStudios/cargo-deny-action
  dependency-version: 2.0.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 09:30:03 +02:00
dependabot[bot]
3ac1f0645a chore(deps): bump actions/setup-node from 6.3.0 to 6.4.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.3.0 to 6.4.0.
- [Commits](53b83947a5...48b55a011b)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 08:29:55 +03:00
Valere Fedronic
9266b89a0f feat(sdk-ui): Aggregation of call declines on to the notification event (#6494) 2026-04-27 14:48:40 +02:00
Michael Goldenberg
b828ff8957 refactor(sdk): add logging for tracking olm machine's crypto store generation
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2026-04-27 12:44:28 +02:00
Doug
91bdb4c7bd chore: Add a changelog entry. 2026-04-27 12:31:37 +02:00
Doug
7f4a9c5ab4 ffi: Rename Encryption related OIDC types to OAuth. 2026-04-27 12:31:37 +02:00
Doug
5690692b9e ffi: Rename Session::oidc_data to Session::oauth_data. 2026-04-27 12:31:37 +02:00
Doug
add403e12f ffi: Rename OidcSessionData to OAuthSessionData. 2026-04-27 12:31:37 +02:00
Doug
f7bf39b346 ffi: Rename OIDC errors to OAuth errors. 2026-04-27 12:31:37 +02:00
Doug
a2a297a5d8 ffi: Rename HomeserverLoginDetails OIDC properties to OAuth. 2026-04-27 12:31:37 +02:00