Commit Graph

12502 Commits

Author SHA1 Message Date
Damir Jelić
737e06b581 Add a missing changelog entry for PR 5177 2025-06-27 14:54:21 +02:00
Richard van der Hoff
4ecd599c15 fix(sdk): correctly import e2ee history in join_room_by_id (#5284)
It turns out that downstream clients can and do call
`Client::join_room_by_id()` rather than `Room::join`, so we need to do
the room key history import in the lower-level method.

---------

Signed-off-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Benjamin Bouvier <benjamin@bouvier.cc>
2025-06-27 12:29:01 +01:00
Doug
c6521a8aaf ffi: Remove the ElementWellKnown struct and related function. 2025-06-27 12:00:33 +02:00
Benjamin Bouvier
4046a59786 refactor(event cache): make filter_duplicate_events operate on a linked chunk id 2025-06-26 16:23:39 +02:00
Benjamin Bouvier
d931cd0ea7 refactor(event cache): include non_empty_all_duplicates in the DeduplicationOutcome 2025-06-26 16:23:39 +02:00
Benjamin Bouvier
a14488617e refactor(common): don't parse the full bundled latest thread event, but only its type
The previous code would parse the entire bundled event, only to look at
its type indirectly. We can do better than this, and only look at the
type instead. This brings a few benefits:

- it is faster, as we don't have to deserialize the entire event
- while the spec seems to indicate that the latest thread event has a
  `room_id`, it seems that, under some circumstances, it does not, as
  indicated by some rageshakes. As such, not parsing as `AnyMessageLike`
  (which mandates a room id) makes it more robust to the absence of a
  room id in there, marking more events as latest events.
2025-06-26 15:33:26 +02:00
Jorge Martín
1de51614f1 fix: Add m.room.avatar to the required state
This works around the issue with removed avatars not being explicitly flagged by sliding sync until https://github.com/element-hq/synapse/issues/18598 is fixed
2025-06-26 14:21:00 +02:00
Robin
6cc98ee9f7 feat(widget): Allow Element Call to learn the room name
The latest mobile designs for Element Call have it displaying the room name in an "app bar". So the Element Call widget will soon start requesting the capability to learn the room name, and the SDK should auto-approve this capability.
2025-06-26 13:28:34 +02:00
Damir Jelić
3a98d46bfa feat: Add a stream to listen for historic room key bundles 2025-06-26 13:22:24 +02:00
Damir Jelić
1558858bde chore: Add a TODO item reminding us that we should zeroize room key bundle contents 2025-06-26 13:22:24 +02:00
Damir Jelić
e4d2f62d48 docs: Document the store/types module properly 2025-06-26 12:11:16 +02:00
Benjamin Bouvier
70f48be582 refactor(sliding sync): avoid an unwrap by inlining a function into its one caller 2025-06-26 12:08:43 +02:00
Ivan Enderlin
836c643769 doc(indexeddb): Add documentation about IndexedKeyBounds and IndexedKeyComponentBounds. 2025-06-25 16:17:34 +02:00
Michael Goldenberg
a48099d5ac refactor(indexeddb): add function to transaction type for clearing all data from an object store in IndexedDB
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
09d8be7b4c doc(indexeddb): add docs to transaction type where they are missing
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
03b8cabc22 refactor(indexeddb): add functions to transaction type for deleting data from IndexedDB
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
07372c475c refactor(indexeddb): add functions to transaction type for adding data to IndexedDB
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
a00e4089e8 refactor(indexeddb): add functions to transaction type for getting data out of IndexedDB
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
1a24b21d42 refactor(indexeddb): add type to represent IndexedDB transactions specific to event cache store
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
f51496fa0f refactor(indexeddb): track corresponding index for type in IndexedKey trait
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
c6ce9c560b refactor(indexeddb): track corresponding object store for type in Indexed trait
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
60af16ada8 refactor(indexeddb): add function for encoding key range from key component range
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
159fb73b0a refactor(indexeddb): join key range encoding functions using indexed key range enum
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
0fa0f2329d refactor(indexeddb): add enum for representing ranges over indexed keys
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
3b64d18c99 refactor(indexeddb): move key component bounds into a separate trait
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
f67fd87e57 refactor(indexeddb): rename IndexedKeyBounds fn's so they are consistent
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
5e64da660c refactor(indexeddb): add default impls for IndexedKeyBounds::{encode_lower, encode_upper}
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
d152ce13a0 refactor(indexddb): add fn's to IndexedKeyBounds to get bounds of key components
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Michael Goldenberg
d021020ee6 refactor(indexeddb): use generic type rather than dynamic type in serializer error
This prevents us from having to add type constraints on the dynamic type
and instead only having to specify the type constraint at the call site.

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-06-25 16:17:34 +02:00
Timo
7e5f22ba9e feat(widgets) Add backwards compatibility hide_header for element-call url query parameter 2025-06-25 16:12:28 +03:00
Timo
6bc6ea4e72 feat(widgets): Update the widget url parameters to use the new header property (was hideHeader which is now deprecated) 2025-06-25 16:12:28 +03:00
Timo
585ae29868 refactor(uniffi): make the sdk widget config struct derive uniffi.
This allows to not duplicate the struct in the uniffi crate.
2025-06-25 16:12:28 +03:00
Benjamin Bouvier
3919c2a89a feat(ffi): also disable the send queues when clearing caches
And beef up the doc comment.
2025-06-25 14:32:25 +02:00
Benjamin Bouvier
7c85e7aa4f feat(room list service): allow to manually expire sessions
This can be used to invalidate the persisted state on disk related to
the sliding sync positions. It's useful to do so when clearing up all
the caches, since the sliding sync `pos`itions are stored in the crypto
store (to benefit from the cross-process lock).
2025-06-25 14:32:25 +02:00
Benjamin Bouvier
4b845e17c8 feat(sliding sync): also empty the list caches when expiring a session 2025-06-25 14:32:25 +02:00
Benjamin Bouvier
394124cda5 refactor(sliding sync): rename invalidate_cached_list to remove_cached_list 2025-06-25 14:32:25 +02:00
Benjamin Bouvier
bbf9bf2c0b feat(room list service): skip the initial state when an initial pos is set 2025-06-25 14:32:25 +02:00
Benjamin Bouvier
67327a0365 doc(sliding sync): remove dubious doc comment
It speaks of a time where the `storage_key` was optional, and it's also
a private field, so it's doubly confusing.
2025-06-25 14:32:25 +02:00
Benjamin Bouvier
5e40426b99 refactor(sliding sync): don't eagerly reload sliding sync state if it's unused 2025-06-25 14:32:25 +02:00
Ivan Enderlin
0f264cac6e feat(ui): RoomListService re-enables share_pos. 2025-06-25 14:32:25 +02:00
Andy Balaam
3c1d0b37e5 refactor(crypto): Provide a specific error type for to-device events from dehydrated devices
This will get more usage soon, when we add a variant for events with
unverified senders.
2025-06-25 12:05:14 +01:00
Stefan Ceriu
62231878cc fix(ffi): make RoomInfo power levels optional as they can be missing depending on the required state
The `m.room.power_levels` state event is not part of the room list required state and computing the RoomInfo would fail in that case.
2025-06-25 12:41:33 +03:00
Benjamin Bouvier
22c99f30f3 chore(sdk): fill in the pull request numbers in changelogs
Signed-off-by: Benjamin Bouvier <benjamin@bouvier.cc>
2025-06-25 10:32:01 +02:00
Benjamin Bouvier
a7efff9849 chore: add changelog entries 😅 2025-06-25 10:32:01 +02:00
Benjamin Bouvier
bc9192f818 refactor!(sdk): make the join_rule and related getters optional
The join rule state event can be missing from a room state. In this
case, it's an API footgun to return a default value; instead, we should
return none and let the caller decide what to do with missing
information.
2025-06-25 10:32:01 +02:00
Richard van der Hoff
0722ed9d8f Indexeddb: support for received room key bundles
Add a new store to keep track of the information we have received about room
key bundles.
2025-06-25 10:26:11 +02:00
Valere Fedronic
1aa933cfd6 widgets: Filter out crypto related fields of raw decrypted to-device
Ensure that only sender/type/content are exposed to the widgets, and not the crypto-related fields.
2025-06-24 16:04:52 +02:00
Ivan Enderlin
e0ab16f979 chore(sdk): Address feedback. 2025-06-24 15:14:57 +02:00
Ivan Enderlin
a9c999af72 doc(sdk): Precise when the side-effect of RoomEventCacheSubscriber happens. 2025-06-24 15:14:57 +02:00
Ivan Enderlin
8156413132 feat(sdk): Introduce RoomEventCacheGenericUpdate, one channel to get update of all rooms.
`RoomEventCache::subscribe` is nice to subscribe to every update
happening inside a room in the event cache. However, the returned
`RoomEventCacheSubscriber` has side-effects when dropped (see
auto-shrink to save memory space). In some situation, this is pretty
annoying. for example, if one wants to listen to multiple room updates,
all the room event cache subscribers must be kept in memory, thus
breaking the side-effects. This isn't always the desired output. In
addition, listening to multiple channels/subscribers at the same is
quite complex, as it implies non-trivial async runtime efforts or
complex future types.

To solve this problem, this patch introduces a new
`EventCache::subscribe_to_room_generic_updates` method, which returns a
single `Receiver<RoomEventCacheGenericUpdate>`.

First off, it hides the details of `RoomEventCacheUpdate` (returned by
`RoomEventCacheSubscriber`), which might be desired, but particularly
lighter because events aren't part of the payload.

Second, one no longer needs to subscribe to all rooms. Only one channel
can be listened to get updates for all rooms. It reduces the complexity
on the caller side, plus `Receiver<RoomEventCacheGenericUpdate>` doesn't
have any side-effect.

This patch tests this feature in 4 situations:

1. when a room is created/loaded empty,
2. when a room is loaded and is not empty because data exists in the storage,
3. when a room receives data from the sync,
4. when a room receives data from the pagination.
2025-06-24 15:14:57 +02:00