[breaking] chore: update rust dependencies (2 updates) #310
Loading…
Reference in a new issue
No description provided.
Delete branch "updatarr/rust-dependencies-17605dfeaf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Updates
rust dependencies.Breaking change detected. Review the release notes before merging.
Automerge: Disabled because breaking change release notes were detected
Updates
matrix-sdk0.19.00.19.1matrix-sdk-sqlite0.19.00.19.1Files
Cargo.tomlRelease notes
matrix-sdk (0.19.0 → 0.19.1)
Source comparison unavailable: source refs for this transition are not known.
matrix-sdk-0.19.0: matrix-sdk 0.19.0Breaking change detected.
Source
Source ref:
mainWhat's Changed
Removed
EventCache::save_eventshas been removed. This API was ideal to create deadlocks in the Event Cache if not used with special care. Moreover, it breaks the isolation between components and was violating the clear separation of responsibility between components.The implications are the following:
Room::messages,Room::event,Room::event_with_contextandRoom::relationsno longer save fetched events in the Event Cache. (#6629)Added
The
ThreadEventCachehas a persistent storage! All events received from the server can now be found locally without reaching the server anymore, which means: thread offline support!Moreover,
ThreadEventCachecontains more events, like edits and redactions! Previously, these events were located in theRoomEventCachefor technical reasons. This is now solved and works as expected. (#6517)The pinned-events cache, aka
PinnedEventsCache, now understands annotations, aka reactions! All annotations to a pinned-event are now part of the pinned-events cache, making it possible to display the reactions live.At the same time, pinned-events are now deduplicated, along with all the related events, like edits, annotations etc. (#6568)
Add
Encryption::dehydrated_devices(), a high-level [MSC3814] dehydrated-device manager that wraps the crypto-crate primitives: probe support, create, rehydrate, delete, weekly rotation, a Secret Storage round trip for the pickle key, and a lifecycle state stream.MatrixMockServergainsmock_*helpers for the four MSC3814 endpoints. (#6606)Added
Account::set_status,Account::clear_status,Account::set_call, andAccount::clear_callto write [MSC4426] user-status profile fields (m.statusandm.call). All four are gated behind the newunstable-msc4426feature. (#6616)Create a
MediaFetchertrait that allows us to replace the existingDefaultMediaFetcherwith any other implementation when building aClient. (#6625)R2D2 (aka
event_cache::Redecryptor) no longer decrypts an already decrypted event. It was taking its job too seriously. Can't blame it, but it was creating unnecessary update in the Event Cache and to all the listeners (Latest Event, Search, Timeline etc.). (#6629)Global message search results are now sorted by full-text search relevance score, interleaving results from different rooms by relevance rather than grouping them per room. (#6645)
Add
SlidingSync::set_room_subscriptionsfor updating room subscriptions non-destructively. This is similar toSlidingSync::reset_and_add_room_subscriptionsbut doesn't clear and then recreate all subscriptions. Instead, it removes existing subscriptions for rooms that are not resubscribed and adds new subscriptions for resubscribed rooms that don't already exist. Unlike SlidingSync::reset_and_add_room_subscriptions`, this method does not mark members as unsynced.(#6652)Add client-owned presence configuration that can optionally send an immediate presence update. Generated sync requests use the client presence by default, which starts as unavailable, while classic sync settings can still override it per request. (#6672)
ThreadEventCacheauto-shrinks when no more subscribers are alive. Subscribers are returned by [ThreadEventCache::subscribe]. When the last subscriber is dropped, it means no external API are listening to this cache, and thus it shrinks to its last chunk of events, to save memory. This behavior was already present forRoomEventCache. (#6690)Added a new top-level
Errorvariant,SignatureErrorrepresenting errors that occurred signing or verifying cryptographic data. (#6715)ClientBuilder::with_x509_signerandClientBuilder::with_x509_verifiernow allow configuring an X.509 signer and verifier for experimental X.509-based cross-signing identity verification.Gated behind the
experimental-x509-identity-verificationfeature. (#6727)The new
EventCache::forget_roommethod properly forget a specific room. It is different fromEventCache::clear_all_eventswhere (i) it's for a particular room instead of all rooms, (ii) it forgets the room, i.e. it's deleted from the Event Cache entirely instead of being cleared only.If you want to forget the room client-wise, look at
Client::forget_room(which callsEventCache::forget_roomat the time of writing). (#6749)Add
Client::subscribe_to_own_profile, returning a stream of the current user's global profile. It emits the currently stored value and re-emits whenever the profile changes during sync, or an empty profile when none is stored. Note: Without the Profiles sliding sync extension enabled only an empty profile will be emitted and no updates will be published. (#6760)Add
Client::rtc_transportsthat queries the RTC transport advertised by the homeserver using the new authenticatedGET /_matrix/client/v1/rtc/transportsAPI. The value is cached for 1 day, and it is possible to force refresh withClient::refresh_rtc_transports, or to by-pass cache withClient::fetch_rtc_transports. [breaking]Client::rtc_focihas been deprecated and should only be used as a fallback for homeservers that do not support the new API (seeClient::well_known_rtc_transports). (#6789)Add support for MSC4515 and RTC transport discovery for widgets. (#6791)
AttachmentConfiggained anextra_contentfield andRoomSendQueue::send()now returns a builder-style future withwith_extra_content(), allowing additional top-level fields to be included in an event's content — e.g. vendor-prefixed keys that server-side push rules can match on (in lieu of MSC3664). Extra fields never override the fields of the event itself. Supported by the send queue and the directRoom::send_attachmentpath. (#6812)Added
Client::enable_automatic_call_status(bool)an opt-in auto-sync that mirrors this device's MatrixRTC participation into the [MSC4426]m.callprofile field. Gated behind theunstable-msc4426feature.Also adds
Room::is_device_in_active_room_call(user_id, device_id)for device-scoped participation checks. (#6825)Propagate the current tracing
Spaninto the E2EE setup task. (#6833)The event cache gained a shared
BackPaginationQueue(EventCache::back_pagination_queue): a single background executor that runs back-pagination requests from every use case byPriority, with a bounded in-flight number (EventCacheConfig::max_concurrent_back_paginations) and onerun per room at a time. Enable it with
ClientBuilder::with_enable_automatic_back_pagination(true). (#6838)Add
Client::disable_well_known_lookup, which disables every/.well-known/matrix/clientrequest performed by the client, for users that must not emit any request to the well-known URI of their domain. When disabled,Client::tile_serverreturnsNone,Client::well_known_rtc_transportsreturns an empty list, andClient::discover_rtc_transportsdoesn't fall back to the well-known foci.Add
ClientBuilder::disable_well_known_lookup, which controls the initial value of theClient::disable_well_known_lookupflag and additionally disables any homeserver discovery performed byClientBuilder::build. Iftrue, the homeserver must then be given withClientBuilder::homeserver_url.ClientBuilder::server_nameandClientBuilder::usernamecan only be resolved through the well-known, soClientBuilder::buildfails with the newClientBuildError::WellKnownLookupDisabledvariant if they are called.Add
Client::discover_rtc_transports, which returns the MatrixRTC transports advertised by the homeserver (MSC4519), with a fallback to the well-knownm.rtc_focias long as well-known lookup is allowed by the client. Transports are exposed as the newRtcTransportenum, with aLiveKitvariant and aCustomvariant carrying the raw JSON for transport types the SDK doesn't know about. (#6845)Added the
msc_4388_rendezvous_server_supported()method to check if the homeserver supports MSC4388 for the QR code login. (#6871)ThreadEventCachenow applies new redactions and saves bundled latest thread events for events coming from the pagination, or that have been redecrypted (by theRedecryptor). (#6888)ThreadEventCachegains 4 new methods:read_receiptsto get theReadReceiptsassociated to theThreadInfo,num_unread_messagesto get the number of unread messages (alias ofread_receipts().await?.num_unread),num_unread_notificationsto get the number of unread notifications (aliasof
read_receipts().await?.num_notifications),num_unread_mentionsto get the number of unread mentions (alias ofread_receipts().await?.num_mentions).(#6893)
Added
Room::retention()to retrieve the current retention policy andRoomPrivacySettings::update_room_retention()to set new values.Leverages Ruma's
unstable-msc1763feature flag. (#6905)Added
Client::get_retention_configurationto retrieve the server level retention policy and per room overrides so a client can determine whether the server enforces any retention policy constraints. (#6908)Media::get_media_preview()returns the OpenGraph-like data a homeserver generates for a URL. It uses the authenticated/_matrix/client/v1/media/preview_urlendpoint when the homeserver supportsit, and falls back to the deprecated
/_matrix/media/v3/preview_urlotherwise. (#6918)Added
Room::effective_retention()to return the final retention policy for a room combining server-wide policy with room-specific. Clients can use this value to determine message retention. (#6919)Add
Room::human_member_idsandRoom::human_member_ids_no_sync, which return the user IDs of the room members with the given memberships, without the service members declared by theio.element.functional_membersstate event. This is a convenient way to find the other party of a direct message. (#6925)SendHandle::abort_with_reason()aborts a queued send likeSendHandle::abort(), and attaches a reason to the redaction that materializes the abort when the event had already been sent by the time the abort was processed. The reason is persisted with the pending redaction, so it survives restarts like the rest of the send queue. (#6931)ThreadEventCachegains a new method:subscribe_to_thread_infoto subscribe to updates of theThreadInfo. This is very similar toRoom::subscribe_info. (#6993)Add
Client::total_unread_notifications, returning the sum of the client-side computed unread notification counts across all joined rooms, counting rooms marked as unread by hand as one each. (#7002)Changed
RoomEventCacheUpdate::AddEphemeralEventsbecomesRoomEventCacheUpdate::AddReadReceipt. It no longer contains anevents: Vec<Raw<AnySyncEphemeralRoomEvent>>but a singleevent: ReceiptEventContent.In the same vein,
ThreadEventCacheUpdateis introduced! Thus,ThreadEventCache::subscribeno longer returns aSubscriber<TimelineVectorDiffs>but aSubscriber<ThreadEventCacheUpdate>. TheTimelineVectorDiffscan be found inThreadEventCacheUpdate::UpdateTimelineEvents, just like its sibling typeRoomEventCacheUpdate. (#6038)The thread cache, aka
ThreadEventCache, has been extracted from the room cache, akaRoomEventCache. To get a thread cache, please use theEventCache::thread()method.The
RoomEventCache::thread_paginationandsubscribe_to_threadmethods have been removed.Before:
After:
Also, the
EventCache::for_roommethod has been renamedroom. (#6517)The pinned-events cache, aka
PinnedEventsCache, has been extracted from the room cache, akaRoomEventCache. To get a pinned-events cache, please use theEventCache::pinned_events()method.The
RoomEventCache::subscribe_to_pinned_eventsmethod have been removed and replaced byPinnedEventsCache::subscribe.Before:
After:
The event-focused cache, aka
EventFocusedCache, has been extracted from the room cache, akaRoomEventCache. To get an event-focused cache, please use theEventCache::event_focused()method.The
RoomEventCache::get_or_create_event_focused_cacheandget_event_focused_cachemethods have been removed.Before:
After:
The
EventCacheStore::clear_all_linked_chunkstrait method has been renamedclear_all_eventsto express its intent better. (#6629)[breaking] The message search helpers now expose their results as
Streams of pages instead of bespoke iterators.Room::search_messagesreturns a stream of pages of(score, event_id)pairs (use the newRoom::search_messages_eventsfor fullTimelineEvents), andGlobalSearchBuilder::build/build_eventsreplace the removedRoomSearchIterator/GlobalSearchIteratortypes. (#6645)Put
ClientInner::MediaFetcherbehind aRwLockso it can be replaced at any time from any thread, without having a mutableClientInnerreference around. (#6689)The
event_cache::RoomEventCacheSubscribertype has been renamed toevent_cache::Subscriber<RoomEventCacheUpdate>. The type has been made generic to be reused byThreadEventCache. The behaviour is exactly the same as it keepsDerefandDerefMuttotokio::sync::mpsc::Receiver. (#6690)Index media, stickers, polls and more message types. Move message parsing responsibility outside the search crate and into the main SDK one. (#6710)
[breaking]
GrantLoginProgress::WaitingForAuthnow has acontinuation_sender: ContinuationMessageSenderfield. Applications must callcontinuation_sender.confirm()once the verification URI has been opened in the browser and the application is ready to proceed, orcontinuation_sender.cancel()to abort; previously it proceeded automatically as soon as this state was reached. This lets applications that suspend or navigate away while the verification URI is open to resume the process explicitly.[breaking]
qrcode::CheckCodeSenderErrorhas been renamed toqrcode::SenderError, since it is now shared withContinuationMessageSender. (#6711)[breaking]
RoomPreview::heroesis nowOption<Vec<RoomHeroWithProfile>>instead ofOption<Vec<RoomHero>>, exposing each hero's status and call fields from their global profile. These fields are only populated when syncing via sliding sync with the profiles extension enabled. (#6733)Methods that delete key backup versions, such as resetting your cryptographic identity now iteratively delete all server-side key backup versions. (#6744)
[breaking]
QRCodeGrantLoginError::UnexpectedMessage'sreceivedfield type andClientBuildError::AutoDiscovery's inner type are nowBoxed to reduce the error enums' sizes.(#6763)
To-device messages forwarded to widgets now include the MSC3819
encryptedboolean in theirdata, indicating whether the original to-device message was received encrypted. (MSC3819) (#6795)[breaking] The check code in the QR code auth is now represented as an
u8directly instead of theCheckCodestruct. (#6819)Subscribing to an already subscribed room now refreshes its settings, e.g. its
timeline_limit, instead of silently keeping the previous ones. (#6828)[breaking] Background back-pagination is now driven by the shared
BackPaginationQueueinstead of a per-room credit system. (#6838)The latest event of a room is now computed with automatic back-pagination: when no suitable candidate is in memory, the room's history is back-paginated until a candidate is found or the start of the timeline is reached. Requires
ClientBuilder::with_enable_automatic_back_pagination(true). (#6840)The send queue now sends requests strictly in the order they were queued, in a given room: a request that failed with an unrecoverable error (and got marked as wedged) blocks all the subsequent requests in the same room from being sent, until it's either retried with
SendHandle::unwedge()or removed withSendHandle::abort(). Previously, a wedged request was skipped over, causing later messages to be sent before it, i.e. out of order.local echo returned by
RoomSendQueue::subscribe(), instead of the echoclaiming the media is still being sent.
Cloudflare and other reverse proxies) is now considered a transient error
again, like the other 5xx status codes: requests failing with it will be
retried, and the send queue treats it as a recoverable error (keeping the
failed request in the queue) instead of wedging the request.
(#6843)
Widget's
get_rtc_transportsaction is now using theClient::discover_rtc_transportsAPI that checks the new authenticatedGET /_matrix/client/v1/rtc/transportsAPI, and falls back to the.well-known/matrix/clientlookup if allowed by the client. Previously it was never falling back to the well-known lookup. (#6845)The room subscription methods of
SlidingSyncare renamed after what they do to the set of subscriptions:subscribe_to_roomsbecomesadd_room_subscriptions,unsubscribe_to_roomsbecomesremove_room_subscriptions,resubscribe_to_roomsbecomesset_room_subscriptions, andclear_and_subscribe_to_roomsbecomesreset_and_add_room_subscriptions. (#6927)Accountautomatically updates the local copy of the user's global profile after updating (to act as a local echo). Requires support for global profile syncing. (#6984)Fix flakiness in the cross-process store lock tests. Dropping a guard does not release the lock at once: the lease-renewal task publishes the release on its next tick. The tests now acquire with
spin_lock_store, which retries with a backoff, instead of a single attempt after a fixed sleep. Each run also gets its own temporary directory for the sqlite database, instead of a predictable shared path under the system temporary directory that carried state into the next run. (#6899)Add
Client::send_encrypted_to_device(behind theexperimental-send-custom-to-devicefeature) to Olm-encrypt a custom to-device message and send it to a set of recipient devices. (#6981)Fixed
The
ThreadSummaryof aThreadEventCacheis computed by using thelatest_eventsinternal API, making it understand more events and delivering a more accurate result. This is still not perfect and complete but at least it's one step in the right direction! (#6517)Resolve the room alias to a room id before evaluating pre-join info. This resolves the asymmetry when using
join_room_by_id_or_alias, ensuring possibly crucial invite handling is handled correctly. (#6618)The Event Cache has now a unique state for all the caches for all the rooms. It fixes numerous bugs but the most notable one is: when a cache has to be reloaded because its state has been invalidated, all the other caches are now reloaded at the same time. Previously, the invalidation was correctly detected, then a single cache was reloaded, and the invalidation was marked as done, thus the other caches couldn't detect it and reload accordingly. It was creating an inconsistency in the data. (#6629)
Prevent deadlocks when waking up the thread subscription catch-up task. (#6667)
Ensure a
VectorDiffis not emitted to subscribers when an event cache is shrunk because no subscribers is listening to it. If there is no subscribers, it's useless to send it anyway, and if in the future, a race happens and a subscriber exists, it must not receive this diff. At the same time, the way the subscribers are tracked and counted have been revisited to use less space in memory and use less atomic operations. (#6684)It is now possible to prevent
matrix-sdkfrom pulling inaws-lc-rsas a transitive dependency by deactivating the newly introducedrustls-aws-lc-rsdefault feature. This is a breaking change for downstream users relying onmatrix-sdkwithout default features, who now have to explicitly enablerustls-aws-lc-rsor register a rustls provider explicitly. (#6705)CrossSigningResetHandle::authnow uses the common timeout helper (frommatrix-sdk-base) instead oftokio::timedirectly. (#6719)Export SupportedPathBuilder and SupportedAuthScheme Client::send uses these in it's trait bounds, but because they were private it wasn't possible to write dependent code that is generic over request types. (#6734)
Replace
tokio::time::sleepwithmatrix_sdk_common::sleep::sleepto ensure QRCode auth compiles to WebAssembly. (#6743)EventCache::clear_all_roomsno longer recreates an emptyLinkedChunkper cache (RoomEventCache,ThreadEventCacheetc.). TheLinkedChunk's first chunk being now created lazily, it ensuresclear_all_roomscan be used to clear or to forget data. (#6752)The correct semantics for one-time key counts are now used when sync v2 is being used. This bug could have previously led to no one-time keys being uploaded to the homeserver. (#6780)
SlidingSync::set_room_subscriptionsnow cancels in-flight requests whenever the set of room subscriptions changes. It used to do so only when a subscription was added and another one was removed in the same call, so a first-time subscription or a singular removal was not sent until the current long poll expired, up to 30s later. (#6828)The
LatestEventValueof a room is no longer left unchanged when it moves between local states, e.g. when a second local event is queued, when the send queue wedges (LocalIsSendingtoLocalCannotBeSent), or when a send is retried. These values have no event ID, and were incorrectly considered equal to each other. (#6836)Fix homeserver switching during QR code login when using rendezvous servers that advertise a valid
.well-knownconfiguration. (#6846)The window in which an app can be signed out by another process rotating the OAuth 2.0 refresh token has been narrowed. The refresh now fetches the authorization server metadata before it reads the token, so a rotation during that request no longer makes the app send a stale token. Being suspended during the token exchange can still produce a sign-out. (#6860)
A rare deadlock has been fixed in
event_cache::caches::aggregator::aggregate_timeline_for_threads.When aggregating the timeline for each thread, we are doing look ups in the room cache, and in the thread caches. Every time we do a look up with
find_event, we are acquiring a read lock over the state. Because look up in the room cache can happen frequently, we were acquiring a read lock over the state for the room cache for the entire lifetime of theaggregate_timeline_for_threadsfunction. However, in some situations, it could lead to a deadlock.Imagine task T1 is running
handle_joined_room_update(which runsaggregate_timeline_for_threads): a read lock over the room state is acquired (L1), and the read lock over a thread state must be acquired for another look up (L2). Before L2 is acquired, task T2 is running a different part of the code, like a pagination, and waits to acquire a write lock (L3). It waits because L1 is still alive and L3 needs an exclusive access. Now, L2 enters the game and cannot be acquired because L3 is waiting. So we have:This is a deadlock.
The fix consists of acquiring a read lock over (all) the states once, to then project the read lock guard to the room and to each thread. This way, L1 is now a combination of L1 and L3. L2 will always wait on L1 to be released. (#6869)
Media::get_media_contentnow deterministically returns the content of a local media (i.e. a media sent by the user not yet received from the server). (#6896)SlidingSync::reset_and_add_room_subscriptionsnow cancels the in-flight request when it removes the last subscriptions. Called with an empty list of rooms, it used to clear the subscriptions without cancelling the request, so the server kept sending the rooms until the current long poll expired, up to 30s later. (#6932)When a sync contained more than one read receipts, only the first one was taken into account. Multiple problems arose from this, e.g. (i) perhaps the first selected receipt is not the correct one (
RoomEventCacheonly cares about theMainorUnthreadedfor example, and should ignore theThreadones), (ii) or more simply the other read receipts were totally ignored! This is now fixed: ephemeral events are triaged similarly to timeline events, insideevent_cache::aggregator. (#6938)Deduplicate thread-subscription catch-up tokens to prevent duplicate catch-up requests. (#6955)
Fix unpinning an event not updating the pinned events timeline through
pinned_event_listener_task.Adding a pinned event updated the list, clearing it also did, but removing one or several items from it, as long as it wasn't empty, didn't. (#6991)
Local medias (as in attachments pending in the send queue) are always cached with
MediaFormat::File, be it the file itself or its thumbnail, so requesting one withMediaFormat::Thumbnailwas failing since the format started being taken into account. (#6996)Restore checksums for UniFFI functions. They were removed to work around an issue where the checksums were incorrectly computed first for some 32bit ARM devices and then for some 64bit ones. That issue is now fixed so we should restore the checksums. (#7046)
matrix-sdk-sqlite (0.19.0 → 0.19.1)
Source comparison unavailable: source refs for this transition are not known.
matrix-sdk-0.19.0: matrix-sdk 0.19.0Breaking change detected.
Source
Source ref:
mainWhat's Changed
Removed
EventCache::save_eventshas been removed. This API was ideal to create deadlocks in the Event Cache if not used with special care. Moreover, it breaks the isolation between components and was violating the clear separation of responsibility between components.The implications are the following:
Room::messages,Room::event,Room::event_with_contextandRoom::relationsno longer save fetched events in the Event Cache. (#6629)Added
The
ThreadEventCachehas a persistent storage! All events received from the server can now be found locally without reaching the server anymore, which means: thread offline support!Moreover,
ThreadEventCachecontains more events, like edits and redactions! Previously, these events were located in theRoomEventCachefor technical reasons. This is now solved and works as expected. (#6517)The pinned-events cache, aka
PinnedEventsCache, now understands annotations, aka reactions! All annotations to a pinned-event are now part of the pinned-events cache, making it possible to display the reactions live.At the same time, pinned-events are now deduplicated, along with all the related events, like edits, annotations etc. (#6568)
Add
Encryption::dehydrated_devices(), a high-level [MSC3814] dehydrated-device manager that wraps the crypto-crate primitives: probe support, create, rehydrate, delete, weekly rotation, a Secret Storage round trip for the pickle key, and a lifecycle state stream.MatrixMockServergainsmock_*helpers for the four MSC3814 endpoints. (#6606)Added
Account::set_status,Account::clear_status,Account::set_call, andAccount::clear_callto write [MSC4426] user-status profile fields (m.statusandm.call). All four are gated behind the newunstable-msc4426feature. (#6616)Create a
MediaFetchertrait that allows us to replace the existingDefaultMediaFetcherwith any other implementation when building aClient. (#6625)R2D2 (aka
event_cache::Redecryptor) no longer decrypts an already decrypted event. It was taking its job too seriously. Can't blame it, but it was creating unnecessary update in the Event Cache and to all the listeners (Latest Event, Search, Timeline etc.). (#6629)Global message search results are now sorted by full-text search relevance score, interleaving results from different rooms by relevance rather than grouping them per room. (#6645)
Add
SlidingSync::set_room_subscriptionsfor updating room subscriptions non-destructively. This is similar toSlidingSync::reset_and_add_room_subscriptionsbut doesn't clear and then recreate all subscriptions. Instead, it removes existing subscriptions for rooms that are not resubscribed and adds new subscriptions for resubscribed rooms that don't already exist. Unlike SlidingSync::reset_and_add_room_subscriptions`, this method does not mark members as unsynced.(#6652)Add client-owned presence configuration that can optionally send an immediate presence update. Generated sync requests use the client presence by default, which starts as unavailable, while classic sync settings can still override it per request. (#6672)
ThreadEventCacheauto-shrinks when no more subscribers are alive. Subscribers are returned by [ThreadEventCache::subscribe]. When the last subscriber is dropped, it means no external API are listening to this cache, and thus it shrinks to its last chunk of events, to save memory. This behavior was already present forRoomEventCache. (#6690)Added a new top-level
Errorvariant,SignatureErrorrepresenting errors that occurred signing or verifying cryptographic data. (#6715)ClientBuilder::with_x509_signerandClientBuilder::with_x509_verifiernow allow configuring an X.509 signer and verifier for experimental X.509-based cross-signing identity verification.Gated behind the
experimental-x509-identity-verificationfeature. (#6727)The new
EventCache::forget_roommethod properly forget a specific room. It is different fromEventCache::clear_all_eventswhere (i) it's for a particular room instead of all rooms, (ii) it forgets the room, i.e. it's deleted from the Event Cache entirely instead of being cleared only.If you want to forget the room client-wise, look at
Client::forget_room(which callsEventCache::forget_roomat the time of writing). (#6749)Add
Client::subscribe_to_own_profile, returning a stream of the current user's global profile. It emits the currently stored value and re-emits whenever the profile changes during sync, or an empty profile when none is stored. Note: Without the Profiles sliding sync extension enabled only an empty profile will be emitted and no updates will be published. (#6760)Add
Client::rtc_transportsthat queries the RTC transport advertised by the homeserver using the new authenticatedGET /_matrix/client/v1/rtc/transportsAPI. The value is cached for 1 day, and it is possible to force refresh withClient::refresh_rtc_transports, or to by-pass cache withClient::fetch_rtc_transports. [breaking]Client::rtc_focihas been deprecated and should only be used as a fallback for homeservers that do not support the new API (seeClient::well_known_rtc_transports). (#6789)Add support for MSC4515 and RTC transport discovery for widgets. (#6791)
AttachmentConfiggained anextra_contentfield andRoomSendQueue::send()now returns a builder-style future withwith_extra_content(), allowing additional top-level fields to be included in an event's content — e.g. vendor-prefixed keys that server-side push rules can match on (in lieu of MSC3664). Extra fields never override the fields of the event itself. Supported by the send queue and the directRoom::send_attachmentpath. (#6812)Added
Client::enable_automatic_call_status(bool)an opt-in auto-sync that mirrors this device's MatrixRTC participation into the [MSC4426]m.callprofile field. Gated behind theunstable-msc4426feature.Also adds
Room::is_device_in_active_room_call(user_id, device_id)for device-scoped participation checks. (#6825)Propagate the current tracing
Spaninto the E2EE setup task. (#6833)The event cache gained a shared
BackPaginationQueue(EventCache::back_pagination_queue): a single background executor that runs back-pagination requests from every use case byPriority, with a bounded in-flight number (EventCacheConfig::max_concurrent_back_paginations) and onerun per room at a time. Enable it with
ClientBuilder::with_enable_automatic_back_pagination(true). (#6838)Add
Client::disable_well_known_lookup, which disables every/.well-known/matrix/clientrequest performed by the client, for users that must not emit any request to the well-known URI of their domain. When disabled,Client::tile_serverreturnsNone,Client::well_known_rtc_transportsreturns an empty list, andClient::discover_rtc_transportsdoesn't fall back to the well-known foci.Add
ClientBuilder::disable_well_known_lookup, which controls the initial value of theClient::disable_well_known_lookupflag and additionally disables any homeserver discovery performed byClientBuilder::build. Iftrue, the homeserver must then be given withClientBuilder::homeserver_url.ClientBuilder::server_nameandClientBuilder::usernamecan only be resolved through the well-known, soClientBuilder::buildfails with the newClientBuildError::WellKnownLookupDisabledvariant if they are called.Add
Client::discover_rtc_transports, which returns the MatrixRTC transports advertised by the homeserver (MSC4519), with a fallback to the well-knownm.rtc_focias long as well-known lookup is allowed by the client. Transports are exposed as the newRtcTransportenum, with aLiveKitvariant and aCustomvariant carrying the raw JSON for transport types the SDK doesn't know about. (#6845)Added the
msc_4388_rendezvous_server_supported()method to check if the homeserver supports MSC4388 for the QR code login. (#6871)ThreadEventCachenow applies new redactions and saves bundled latest thread events for events coming from the pagination, or that have been redecrypted (by theRedecryptor). (#6888)ThreadEventCachegains 4 new methods:read_receiptsto get theReadReceiptsassociated to theThreadInfo,num_unread_messagesto get the number of unread messages (alias ofread_receipts().await?.num_unread),num_unread_notificationsto get the number of unread notifications (aliasof
read_receipts().await?.num_notifications),num_unread_mentionsto get the number of unread mentions (alias ofread_receipts().await?.num_mentions).(#6893)
Added
Room::retention()to retrieve the current retention policy andRoomPrivacySettings::update_room_retention()to set new values.Leverages Ruma's
unstable-msc1763feature flag. (#6905)Added
Client::get_retention_configurationto retrieve the server level retention policy and per room overrides so a client can determine whether the server enforces any retention policy constraints. (#6908)Media::get_media_preview()returns the OpenGraph-like data a homeserver generates for a URL. It uses the authenticated/_matrix/client/v1/media/preview_urlendpoint when the homeserver supportsit, and falls back to the deprecated
/_matrix/media/v3/preview_urlotherwise. (#6918)Added
Room::effective_retention()to return the final retention policy for a room combining server-wide policy with room-specific. Clients can use this value to determine message retention. (#6919)Add
Room::human_member_idsandRoom::human_member_ids_no_sync, which return the user IDs of the room members with the given memberships, without the service members declared by theio.element.functional_membersstate event. This is a convenient way to find the other party of a direct message. (#6925)SendHandle::abort_with_reason()aborts a queued send likeSendHandle::abort(), and attaches a reason to the redaction that materializes the abort when the event had already been sent by the time the abort was processed. The reason is persisted with the pending redaction, so it survives restarts like the rest of the send queue. (#6931)ThreadEventCachegains a new method:subscribe_to_thread_infoto subscribe to updates of theThreadInfo. This is very similar toRoom::subscribe_info. (#6993)Add
Client::total_unread_notifications, returning the sum of the client-side computed unread notification counts across all joined rooms, counting rooms marked as unread by hand as one each. (#7002)Changed
RoomEventCacheUpdate::AddEphemeralEventsbecomesRoomEventCacheUpdate::AddReadReceipt. It no longer contains anevents: Vec<Raw<AnySyncEphemeralRoomEvent>>but a singleevent: ReceiptEventContent.In the same vein,
ThreadEventCacheUpdateis introduced! Thus,ThreadEventCache::subscribeno longer returns aSubscriber<TimelineVectorDiffs>but aSubscriber<ThreadEventCacheUpdate>. TheTimelineVectorDiffscan be found inThreadEventCacheUpdate::UpdateTimelineEvents, just like its sibling typeRoomEventCacheUpdate. (#6038)The thread cache, aka
ThreadEventCache, has been extracted from the room cache, akaRoomEventCache. To get a thread cache, please use theEventCache::thread()method.The
RoomEventCache::thread_paginationandsubscribe_to_threadmethods have been removed.Before:
After:
Also, the
EventCache::for_roommethod has been renamedroom. (#6517)The pinned-events cache, aka
PinnedEventsCache, has been extracted from the room cache, akaRoomEventCache. To get a pinned-events cache, please use theEventCache::pinned_events()method.The
RoomEventCache::subscribe_to_pinned_eventsmethod have been removed and replaced byPinnedEventsCache::subscribe.Before:
After:
The event-focused cache, aka
EventFocusedCache, has been extracted from the room cache, akaRoomEventCache. To get an event-focused cache, please use theEventCache::event_focused()method.The
RoomEventCache::get_or_create_event_focused_cacheandget_event_focused_cachemethods have been removed.Before:
After:
The
EventCacheStore::clear_all_linked_chunkstrait method has been renamedclear_all_eventsto express its intent better. (#6629)[breaking] The message search helpers now expose their results as
Streams of pages instead of bespoke iterators.Room::search_messagesreturns a stream of pages of(score, event_id)pairs (use the newRoom::search_messages_eventsfor fullTimelineEvents), andGlobalSearchBuilder::build/build_eventsreplace the removedRoomSearchIterator/GlobalSearchIteratortypes. (#6645)Put
ClientInner::MediaFetcherbehind aRwLockso it can be replaced at any time from any thread, without having a mutableClientInnerreference around. (#6689)The
event_cache::RoomEventCacheSubscribertype has been renamed toevent_cache::Subscriber<RoomEventCacheUpdate>. The type has been made generic to be reused byThreadEventCache. The behaviour is exactly the same as it keepsDerefandDerefMuttotokio::sync::mpsc::Receiver. (#6690)Index media, stickers, polls and more message types. Move message parsing responsibility outside the search crate and into the main SDK one. (#6710)
[breaking]
GrantLoginProgress::WaitingForAuthnow has acontinuation_sender: ContinuationMessageSenderfield. Applications must callcontinuation_sender.confirm()once the verification URI has been opened in the browser and the application is ready to proceed, orcontinuation_sender.cancel()to abort; previously it proceeded automatically as soon as this state was reached. This lets applications that suspend or navigate away while the verification URI is open to resume the process explicitly.[breaking]
qrcode::CheckCodeSenderErrorhas been renamed toqrcode::SenderError, since it is now shared withContinuationMessageSender. (#6711)[breaking]
RoomPreview::heroesis nowOption<Vec<RoomHeroWithProfile>>instead ofOption<Vec<RoomHero>>, exposing each hero's status and call fields from their global profile. These fields are only populated when syncing via sliding sync with the profiles extension enabled. (#6733)Methods that delete key backup versions, such as resetting your cryptographic identity now iteratively delete all server-side key backup versions. (#6744)
[breaking]
QRCodeGrantLoginError::UnexpectedMessage'sreceivedfield type andClientBuildError::AutoDiscovery's inner type are nowBoxed to reduce the error enums' sizes.(#6763)
To-device messages forwarded to widgets now include the MSC3819
encryptedboolean in theirdata, indicating whether the original to-device message was received encrypted. (MSC3819) (#6795)[breaking] The check code in the QR code auth is now represented as an
u8directly instead of theCheckCodestruct. (#6819)Subscribing to an already subscribed room now refreshes its settings, e.g. its
timeline_limit, instead of silently keeping the previous ones. (#6828)[breaking] Background back-pagination is now driven by the shared
BackPaginationQueueinstead of a per-room credit system. (#6838)The latest event of a room is now computed with automatic back-pagination: when no suitable candidate is in memory, the room's history is back-paginated until a candidate is found or the start of the timeline is reached. Requires
ClientBuilder::with_enable_automatic_back_pagination(true). (#6840)The send queue now sends requests strictly in the order they were queued, in a given room: a request that failed with an unrecoverable error (and got marked as wedged) blocks all the subsequent requests in the same room from being sent, until it's either retried with
SendHandle::unwedge()or removed withSendHandle::abort(). Previously, a wedged request was skipped over, causing later messages to be sent before it, i.e. out of order.local echo returned by
RoomSendQueue::subscribe(), instead of the echoclaiming the media is still being sent.
Cloudflare and other reverse proxies) is now considered a transient error
again, like the other 5xx status codes: requests failing with it will be
retried, and the send queue treats it as a recoverable error (keeping the
failed request in the queue) instead of wedging the request.
(#6843)
Widget's
get_rtc_transportsaction is now using theClient::discover_rtc_transportsAPI that checks the new authenticatedGET /_matrix/client/v1/rtc/transportsAPI, and falls back to the.well-known/matrix/clientlookup if allowed by the client. Previously it was never falling back to the well-known lookup. (#6845)The room subscription methods of
SlidingSyncare renamed after what they do to the set of subscriptions:subscribe_to_roomsbecomesadd_room_subscriptions,unsubscribe_to_roomsbecomesremove_room_subscriptions,resubscribe_to_roomsbecomesset_room_subscriptions, andclear_and_subscribe_to_roomsbecomesreset_and_add_room_subscriptions. (#6927)Accountautomatically updates the local copy of the user's global profile after updating (to act as a local echo). Requires support for global profile syncing. (#6984)Fix flakiness in the cross-process store lock tests. Dropping a guard does not release the lock at once: the lease-renewal task publishes the release on its next tick. The tests now acquire with
spin_lock_store, which retries with a backoff, instead of a single attempt after a fixed sleep. Each run also gets its own temporary directory for the sqlite database, instead of a predictable shared path under the system temporary directory that carried state into the next run. (#6899)Add
Client::send_encrypted_to_device(behind theexperimental-send-custom-to-devicefeature) to Olm-encrypt a custom to-device message and send it to a set of recipient devices. (#6981)Fixed
The
ThreadSummaryof aThreadEventCacheis computed by using thelatest_eventsinternal API, making it understand more events and delivering a more accurate result. This is still not perfect and complete but at least it's one step in the right direction! (#6517)Resolve the room alias to a room id before evaluating pre-join info. This resolves the asymmetry when using
join_room_by_id_or_alias, ensuring possibly crucial invite handling is handled correctly. (#6618)The Event Cache has now a unique state for all the caches for all the rooms. It fixes numerous bugs but the most notable one is: when a cache has to be reloaded because its state has been invalidated, all the other caches are now reloaded at the same time. Previously, the invalidation was correctly detected, then a single cache was reloaded, and the invalidation was marked as done, thus the other caches couldn't detect it and reload accordingly. It was creating an inconsistency in the data. (#6629)
Prevent deadlocks when waking up the thread subscription catch-up task. (#6667)
Ensure a
VectorDiffis not emitted to subscribers when an event cache is shrunk because no subscribers is listening to it. If there is no subscribers, it's useless to send it anyway, and if in the future, a race happens and a subscriber exists, it must not receive this diff. At the same time, the way the subscribers are tracked and counted have been revisited to use less space in memory and use less atomic operations. (#6684)It is now possible to prevent
matrix-sdkfrom pulling inaws-lc-rsas a transitive dependency by deactivating the newly introducedrustls-aws-lc-rsdefault feature. This is a breaking change for downstream users relying onmatrix-sdkwithout default features, who now have to explicitly enablerustls-aws-lc-rsor register a rustls provider explicitly. (#6705)CrossSigningResetHandle::authnow uses the common timeout helper (frommatrix-sdk-base) instead oftokio::timedirectly. (#6719)Export SupportedPathBuilder and SupportedAuthScheme Client::send uses these in it's trait bounds, but because they were private it wasn't possible to write dependent code that is generic over request types. (#6734)
Replace
tokio::time::sleepwithmatrix_sdk_common::sleep::sleepto ensure QRCode auth compiles to WebAssembly. (#6743)EventCache::clear_all_roomsno longer recreates an emptyLinkedChunkper cache (RoomEventCache,ThreadEventCacheetc.). TheLinkedChunk's first chunk being now created lazily, it ensuresclear_all_roomscan be used to clear or to forget data. (#6752)The correct semantics for one-time key counts are now used when sync v2 is being used. This bug could have previously led to no one-time keys being uploaded to the homeserver. (#6780)
SlidingSync::set_room_subscriptionsnow cancels in-flight requests whenever the set of room subscriptions changes. It used to do so only when a subscription was added and another one was removed in the same call, so a first-time subscription or a singular removal was not sent until the current long poll expired, up to 30s later. (#6828)The
LatestEventValueof a room is no longer left unchanged when it moves between local states, e.g. when a second local event is queued, when the send queue wedges (LocalIsSendingtoLocalCannotBeSent), or when a send is retried. These values have no event ID, and were incorrectly considered equal to each other. (#6836)Fix homeserver switching during QR code login when using rendezvous servers that advertise a valid
.well-knownconfiguration. (#6846)The window in which an app can be signed out by another process rotating the OAuth 2.0 refresh token has been narrowed. The refresh now fetches the authorization server metadata before it reads the token, so a rotation during that request no longer makes the app send a stale token. Being suspended during the token exchange can still produce a sign-out. (#6860)
A rare deadlock has been fixed in
event_cache::caches::aggregator::aggregate_timeline_for_threads.When aggregating the timeline for each thread, we are doing look ups in the room cache, and in the thread caches. Every time we do a look up with
find_event, we are acquiring a read lock over the state. Because look up in the room cache can happen frequently, we were acquiring a read lock over the state for the room cache for the entire lifetime of theaggregate_timeline_for_threadsfunction. However, in some situations, it could lead to a deadlock.Imagine task T1 is running
handle_joined_room_update(which runsaggregate_timeline_for_threads): a read lock over the room state is acquired (L1), and the read lock over a thread state must be acquired for another look up (L2). Before L2 is acquired, task T2 is running a different part of the code, like a pagination, and waits to acquire a write lock (L3). It waits because L1 is still alive and L3 needs an exclusive access. Now, L2 enters the game and cannot be acquired because L3 is waiting. So we have:This is a deadlock.
The fix consists of acquiring a read lock over (all) the states once, to then project the read lock guard to the room and to each thread. This way, L1 is now a combination of L1 and L3. L2 will always wait on L1 to be released. (#6869)
Media::get_media_contentnow deterministically returns the content of a local media (i.e. a media sent by the user not yet received from the server). (#6896)SlidingSync::reset_and_add_room_subscriptionsnow cancels the in-flight request when it removes the last subscriptions. Called with an empty list of rooms, it used to clear the subscriptions without cancelling the request, so the server kept sending the rooms until the current long poll expired, up to 30s later. (#6932)When a sync contained more than one read receipts, only the first one was taken into account. Multiple problems arose from this, e.g. (i) perhaps the first selected receipt is not the correct one (
RoomEventCacheonly cares about theMainorUnthreadedfor example, and should ignore theThreadones), (ii) or more simply the other read receipts were totally ignored! This is now fixed: ephemeral events are triaged similarly to timeline events, insideevent_cache::aggregator. (#6938)Deduplicate thread-subscription catch-up tokens to prevent duplicate catch-up requests. (#6955)
Fix unpinning an event not updating the pinned events timeline through
pinned_event_listener_task.Adding a pinned event updated the list, clearing it also did, but removing one or several items from it, as long as it wasn't empty, didn't. (#6991)
Local medias (as in attachments pending in the send queue) are always cached with
MediaFormat::File, be it the file itself or its thumbnail, so requesting one withMediaFormat::Thumbnailwas failing since the format started being taken into account. (#6996)Restore checksums for UniFFI functions. They were removed to work around an issue where the checksums were incorrectly computed first for some 32bit ARM devices and then for some 64bit ones. That issue is now fixed so we should restore the checksums. (#7046)
[breaking] chore: update rust dependencies (0.19.0 → 0.19.1)to [breaking] chore: update rust dependencies (2 updates)17a0a970957e6c498b117e6c498b118928665d05Pull request closed