48 KiB
Changelog
All notable changes to this project will be documented in this file.
[Unreleased] - ReleaseDate
[0.14.0] - 2025-09-04
Features
-
Client::fetch_thread_subscriptionsimplements support for the companion endpoint of the experimental MSC4308, allowing to fetch thread subscriptions for a given range, as specified by the MSC. (#5590) -
Add a
Client::joined_space_roomsmethod that allows retrieving the list of joined spaces. -
Room::enable_encryptionandRoom::enable_encryption_with_state_event_encryptionwill poll the encryption state for up to 3 seconds, rather than checking once after a single sync has completed. (#5559) -
Add
Room::enable_encryption_with_stateto enable E2E encryption with encrypted state event support, gated behind theexperimental-encrypted-state-eventsfeature. (#5557) -
Add
ignore_timeout_on_first_syncto theSyncSettings, which should allow to have a quicker first response when using one of thesync,sync_with_callback,sync_with_result_callbackorsync_streammethods onClient, if the response is empty. (#5481) -
The methods to use the
/v3/syncendpoint set theuse_state_afterfield, which means that, if the server supports it, the response will contain the state changes between the last sync and the end of the timeline. (#5488) -
Add experimental support for MSC4306, with the
Room::fetch_thread_subscription(),Room::subscribe_thread()andRoom::unsubscribe_thread()methods. (#5439) -
[breaking]
RoomMemberRolehas a newCreatorvariant, that differentiates room creators with infinite power levels, as introduced in room version 12. (#5436) -
Add
Account::fetch_account_data_staticto fetch account data from the server with a statically-known type, with a signature similar toAccount::account_data. (#5424) -
Add support to accept historic room key bundles that arrive out of order, i.e. the bundle arrives after the invite has already been accepted. (#5322)
-
[breaking]
OAuth::loginnow allows requesting additional scopes for the authorization code grant. (#5395)
Refactor
- [breaking] Upgrade ruma to 0.13.0 (#5623)
- [breaking]
SyncSettingstoken is nowSyncTokenenum type which has default behaviour ofSyncToken::ReusePrevioustoken. This breaksClient::sync_once. For old behaviour, set the token toSyncToken::NoTokenwith the usualSyncSettings::tokensetter. - [breaking] Change the upload_encrypted_file and make it clone the client instead of owning it. The lifetime of the
UploadEncryptedFilerequest returned byClient::upload_encrypted_file()only depends on the request lifetime now. - [breaking] Add an
IsPrefix = Falsebound to theaccount_data()andfetch_account_data_static()methods ofAccount. These methods only worked for events where the full event type is statically-known, and this is now enforced at compile-time.account_data_raw()andfetch_account_data()respectively can be used instead for event types with a variable suffix. (#5444) - [breaking]
RoomMemberRole::suggested_role_for_power_level()andRoomMemberRole::suggested_power_level()now useUserPowerLevelto represent power levels instead ofi64to differentiate the infinite power level of creators, as introduced in room version 12. (#5436) - [breaking] The
reasonargument ofRoom::report_room()is now required, due to a clarification in the spec. (#5337) - [breaking] The
join_rulefield ofRoomPreviewis now aJoinRuleSummary. It has the same variants asSpaceRoomJoinRulebut contains as summary of the allow rules for the restricted variants. (#5337) - [breaking] The MSRV has been bumped to Rust 1.88. (#5431)
- [breaking]
Room::send_call_notificationandRoom::send_call_notification_if_neededhave been removed, since the event type they send is outdated, andClientis not actually supposed to be able to join MatrixRTC sessions (yet). In practice, users of these methods probably already rely on another MatrixRTC implementation to participate in sessions, and such an implementation should be capable of sending notifications itself.
Bugfix
- The event handlers APIs now properly support events whose type is not fully statically-known. Before, those events would never trigger an event handler. (#5444)
- All HTTP requests now have a default
read_timeoutof 60s, which means they'll disconnect if the connection stalls.RequestConfig::timeoutis now optional and can be disabled on a per-request basis. This will be done for the requests used to download media, so they don't get cancelled after the default 30s timeout for no good reason. (#5437)
[0.13.0] - 2025-07-10
Security Fixes
- Fix SQL injection vulnerability in
EventCache(d0c0100, Moderate, CVE-2025-53549, GHSA-275g-g844-73jh)
Bug fixes
Room.leave()will now attempt to leave all reachable predecessors too. (#5381)- When joining a room via
Client::join_room_by_id(), if the client hasenable_share_history_on_inviteenabled, we will correctly check for received room key bundles. Previously this was only done when callingRoom::join. (#5043)
Features
- Add
Client::supported_versions(), which returns the results of bothClient::server_versions()andClient::unstable_features()with a single call. (#5357) WidgetDriver::send_to_deviceNow supports sending encrypted to-device messages. (#5252)Client::add_event_handler: SetOption<EncryptionInfo>inEventHandlerDatafor to-device messages. If the to-device message was encrypted, theEncryptionInfowill be set. If it isNonethe message was sent in clear. (#5099)EventCache::subscribe_to_room_generic_updatesis added to subscribe to all room updates without having to subscribe to all rooms individually (#5247)- [breaking] The element call widget URL configuration struct uses the new
headerurl parameter instead of the now deprecatedhideHeaderparameter. This is only compatible with EC v0.13.0 or newer. - [breaking]
RoomEventCacheGenericUpdategains a newClearvariant, and sees itsTimelineUpdatedvariant being renamed toUpdateTimeline. (#5363) - [breaking]: The element call widget URL configuration struct uses the new
headerurl parameter instead of the now deprecatedhideHeaderparameter. This is only compatible with EC v0.13.0 or newer. - [breaking]: The experimental
Encryption::encrypt_and_send_raw_to_devicefunction now takes ashare_strategyparameter, and will not send to devices that do not satisfy the given share strategy. (#5457)
Refactor
- [breaking]:
Client::unstable_features()returns aBTreeSet<FeatureFlag>, containing only the features whose value was set to true in the response to the/versionsendpoint. (#5357) - [breaking]: The family of
Room::can_user_*methods has been removed. The same functionality can be accessed using theRoomPowerLevels::user_can_*family of methods. TheRoomPowerLevelsobject can be accessed using theRoom::power_levels()method. (#5250) ClientServerCapabilitieshas been renamed toClientServerInfo. Alongside this,Client::reset_server_infois nowClient::reset_server_infoandClient::fetch_server_capabilitiesis nowClient::fetch_server_versions, returning the server versions response directly. (#5167)RoomEventCacheListeneris renamedRoomEventCacheSubscriber(#5269)RoomPreview::join_ruleis now optional, and will be set toNoneif the join rule state event is missing for a given room. (#5278)
Bug fixes
m.room.avatarhas been added as required state for sliding sync until the existing backend issue causing deleted room avatars to not be flagged is fixed. (#5293)
[0.12.0] - 2025-06-10
Features
Client::send_call_notification_if_needednow returnsResult<bool>instead ofResult<()>so we can check if the event was sent. (#5171)- Added
SendMediaUploadRequestwrapper forSendRequest, which checks the size of the request to upload making sure it doesn't exceed them.upload.sizevalue that can be fetched throughClient::load_or_fetch_max_upload_size. (#5119) - Add
ClientBuilder::with_enable_share_history_on_inviteto enable experimental support for sharing encrypted room history on invite, per MSC4268. (#5141) Room::list_threads()is a new method to list all the threads in a room. (#4973)Room::relations()is a new method to list all the events related to another event ("relations"), with additional filters for relation type or relation type + event type. (#4973)- The
EventCache's persistent storage has been enabled by default. This means that all the events received by sync or back-paginations will be stored, in memory or on disk, by default, as soon asEventCache::subscribe()has been called (which happens automatically if you're using thematrix_sdk_ui::Timeline). This offers offline access and super quick back-paginations (when the cache has been filled) whenever the event cache is enabled. It's also not possible to disable the persistent storage anymore. Note that by default, the event cache store uses an in-memory store, so the events will be lost when the process exits. To store the events on disk, you need to use the sqlite event cache store. (#4308) Room::set_unread_flag()now sets the stablem.marked_unreadroom account data, which was stabilized in Matrix 1.12.Room::is_marked_unread()also ignores the unstablecom.famedly.marked_unreadroom account data if the stable variant is present. (#5034)Encryption::encrypt_and_send_raw_to_device: Introduced as an experimental method for sending custom encrypted to-device events. This feature is gated behind theexperimental-send-custom-to-deviceflag, as it remains under active development and may undergo changes. (4998)Room::send_single_receipt()andRoom::send_multiple_receipts()now also unset the unread flag of the room if an unthreaded read receipt is sent. (#5055)Client::is_user_ignored(&UserId)can be used to check if a user is currently ignored. (#5081)RoomSendQueue::send_galleryhas been added to allow sending MSC4274-style media galleries via the send queue under theunstable-msc4274feature. (#4977)
Bug fixes
- A invited DM room joined with
Client::join_room_by_id()orClient::join_room_by_id_or_alias()will now be correctly marked as a DM. (#5043) - API responses with an HTTP status code
520won't be retried anymore, as this is used by some proxies (including Cloudflare) to warn that an unknown error has happened in the actual server. (#5105)
Refactor
- Support for the deprecated
GET /auth_issuerendpoint was removed in theOAuthAPI. Only theGET /auth_metadataendpoint is used now. (#5302) Room::push_context()has been renamed intoRoom::push_condition_room_ctx(). The newerRoom::push_contextnow returns amatrix_sdk::Room::PushContext, which can be used to compute the push actions for any event. (#4962)Room::decrypt_event()now requires an extramatrix_sdk::Room::PushContextparameter to compute the push notifications for the decrypted event. (#4962)SlidingSyncRoomhas been removed. With it, theSlidingSync::get_room,get_all_rooms,get_rooms,get_number_of_rooms, andFrozenSlidingSyncmethods and type have been removed. (#5047)Room::set_unread_flag()is now a no-op if the unread flag already has the wanted value. (#5055)
[0.11.0] - 2025-04-11
Features
-
Room::load_or_fetch_event()is a new method that will find an event in the event cache (if enabled), or using network likeRoom::event()does. (#4837) -
[breaking]: The element call widget URL configuration struct (
VirtualElementCallWidgetOptions) and URL generation have changed.- It supports the new fields:
hide_screensharing,posthog_api_host,posthog_api_key,rageshake_submit_url,sentry_dsn,sentry_environment. - The widget URL will no longer automatically add
/roomto the base domain. For backward compatibility the app itself would need to add/roomto theelement_call_url. - And replaced:
analytics_id->posthog_user_id(The widget URL query parameters will includeanalytics_id&posthog_user_idfor backward compatibility)skip_lobby->intent(Intent.StartCall,Intent.JoinExisting. The widget URL query parameters will includeskip_lobbyifintentisIntent.StartCallfor backward compatibility)
VirtualElementCallWidgetOptionsnow implementsDefault. (#4822)
- It supports the new fields:
-
[breaking]: The
RoomPagination::run_backwardsmethod has been removed and replaced by two simpler methods:RoomPagination::run_backwards_until(), which will retrigger back-paginations until a certain number of events have been received (and retry if the timeline has been reset in the background).RoomPagination::run_backwards_once(), which will run a single back-pagination (and retry if the timeline has been reset in the background). (#4689)
-
[breaking]: The
OAuth::account_management_urlmethod now caches the result of a call, subsequent calls to the method will not contact the server for a while, instead the cached URI will be returned. If caching of this URI is not desirable, theOAuth::fetch_account_management_urlmethod can be used. (#4663) -
The
MediaRetentionPolicycan now trigger regular cleanups with its newcleanup_frequencysetting. (#4603) -
[breaking] The HTTP client only allows TLS 1.2 or newer, as recommended by BCP 195. (#4647)
-
Add
Room::report_roomapi. (#4713) -
Client::notification_clientwill create a copy of the existingClient, but now it'll make sure it doesn't handle any verification events to avoid an issue with these events being received and processed twice ifNotificationProcessSetupwasSingleSetup. -
[breaking]
Room::is_encryptedis replaced byRoom::latest_encryption_statewhich returns a value of the newEncryptionStateenum; anotherRoom::encryption_statenon-async and infallible method is added to get theEncryptionStatewithout callingRoom::request_encryption_state. This latter method is also now public. (#4777). One can safely replace:room.is_encrypted().await?by
room.latest_encryption_state().await?.is_encrypted() -
LocalServerBuilder, behind thelocal-serverfeature, can be used to spawn a server when the end-user needs to be redirected to an address on localhost. It was used forSsoLoginBuilderand can now be used in other cases, like for login with the OAuth 2.0 API. (#4804 -
The
OAuthapi is no longer gated behind theexperimental-oidccargo feature. (#4830) -
Re-export
SqliteStoreConfigand addClientBuilder::sqlite_store_with_config_and_cache_pathto configure the SQLite store with the newSqliteStoreConfigstructure (#4870) -
Add
Client::logout()that allows to log out regardless of theAuthApithat is used for the session. (#4886)
Bug Fixes
- Ensure all known secrets are removed from secret storage when invoking the
Recovery::disable()method. While the server is not guaranteed to delete these secrets, making an attempt to remove them is considered good practice. Note that all secrets are uploaded to the server in an encrypted form. (#4629) - Most of the features in the
OAuthAPI should now work under WASM (#4830)
Refactor
- [breaking] Switched from the unmaintained backoff crate to the backon
crate. As part of this change, the
RequestConfig::retry_limitmethod was renamed toRequestConfig::max_retry_timeand the parameter for the method was updated from au64to ausize. (#4916) - [breaking] We now require Rust 1.85 as the minimum supported Rust version to compile. Yay for async closures! (#4745)
- [breaking] The
server_urlandserver_responsemethods ofSsoLoginBuilderare replaced byserver_builder(), which allows more fine-grained settings for the server. (#4804 - [breaking]:
OidcSessionTokensandMatrixSessionTokenshave been merged intoSessionTokens. Methods to get and watch session tokens are now available directly onClient.(MatrixAuth/Oidc)::session_tokens_stream(), can be replaced byClient::subscribe_to_session_changes()and then callingClient::session_tokens()on aSessionChange::TokenRefreshed. (#4772) - [breaking]
Oidc::url_for_oidc()doesn't take theVerifiedClientMetadatato register as an argument, the one inOidcRegistrationsis used instead. However it now takes the redirect URI to use, instead of always using the first one in the client metadata. (#4771) - [breaking] The
server_urlandserver_responsemethods ofSsoLoginBuilderare replaced byserver_builder(), which allows more fine-grained settings for the server. - [breaking]: Rename the
OidcAPI toOAuth, since it's using almost exclusively OAuth 2.0 rather than OpenID Connect. (#4805)- The
oidcmodule was renamed tooauth. Client::oidc()was renamed toClient::oauth()and theAuthApi::Oidcvariant was renamed toAuthApi::OAuth.OidcSessionwas renamed toOAuthSessionand theAuthSession::Oidcvariant was renamed toAuthSession::OAuth.OidcAuthCodeUrlBuilderandOidcAuthorizationDatawere renamed toOAuthAuthCodeUrlBuilderandOAuthAuthorizationData.OidcErrorwas renamed toOAuthErrorand theRefreshTokenError::Oidcvariant was renamed toRefreshTokenError::OAuth.Oidc::provider_metadata()was renamed toOAuth::server_metadata().
- The
- [breaking]:
OAuth::finish_login()must always be called, instead ofOAuth::finish_authorization()(#4817)OAuth::abort_authorization()was renamed toOAuth::abort_login().OAuth::finish_login()can be called several times for the same session, but it will return an error if it is called with a new session.OAuthError::MissingDeviceIdwas removed, it cannot occur anymore.
- [breaking]
OidcRegistrationswas renamed toOAuthRegistrationStore. (#4814)OidcRegistrationsErrorwas renamed toOAuthRegistrationStoreError.- The
registrationsmodule was renamed and is now private.OAuthRegistrationStoreandClientIdare exported fromoauth, andOAuthRegistrationStoreErroris exported fromoauth::error. - All the methods of
OAuthRegistrationStoreare nowasyncand return aResult: errors when reading the file are no longer ignored, and blocking I/O is performed in a separate thread. OAuthRegistrationStore::new()takes aPathBufinstead of aPath.OAuthRegistrationStore::new()no longer takes astatic_registrationsparameter. It should be provided if needed withOAuthRegistrationStore::with_static_registrations().
- [breaking] Allow to use any registration method with
OAuth::login()andOAuth::login_with_qr_code(). (#4827)OAuth::logintakes an optionalClientRegistrationDatato be able to register and login with a single function call.OAuth::url_for_oidc()was removed, it can be replaced by a call toOAuth::login().OAuth::login_with_qr_code()takes an optionalClientRegistrationDatainstead of the client metadata.OAuth::finish_logintakes aUrlOrQueryinstead of anAuthorizationCode. The deserialization of the query string will occur inside the method and eventual errors will be handled.OAuth::login_with_oidc_callback()was removed, it can be replaced by a call toOAuth::finish_login().AuthorizationResponse,AuthorizationCodeandAuthorizationErrorare now private.
- [breaking] -
OAuth::account_management_url()andOAuth::fetch_account_management_url()don't take an action anymore but return anAccountManagementUrlBuilder. The final URL can be obtained withAccountManagementUrlBuilder::build(). (#4831) - [breaking]
Client::storeis renamedstate_store(#4851) - [breaking] The parameters
event_idandenforce_threadon [Room::make_reply_event()] have been wrapped in areplystruct parameter. (#4880) - [breaking]: The
OidcAPI was updated to match the latest version of the next-gen auth MSCs. The most notable change is that these MSCs are now based on OAuth 2.0 rather then OpenID Connect. To reflect that, most types have been renamed, with theOidcprefix changed toOAuth. The API has also been cleaned up, it is now simpler and has fewer methods while keeping most of the available features. Here is a detailed list of changes:- Rename the
OidcAPI toOAuth, since it's using almost exclusively OAuth 2.0 rather than OpenID Connect. (#4805)- The
oidcmodule was renamed tooauth. Client::oidc()was renamed toClient::oauth()and theAuthApi::Oidcvariant was renamed toAuthApi::OAuth.OidcSessionwas renamed toOAuthSessionand theAuthSession::Oidcvariant was renamed toAuthSession::OAuth.OidcAuthCodeUrlBuilderandOidcAuthorizationDatawere renamed toOAuthAuthCodeUrlBuilderandOAuthAuthorizationData.OidcErrorwas renamed toOAuthErrorand theRefreshTokenError::Oidcvariant was renamed toRefreshTokenError::OAuth.Oidc::provider_metadata()was renamed toOAuth::server_metadata().
- The
- The
authentication::qrcodemodule was moved insideauthentication::oauth, because it is only available through theOAuthAPI. (#4687) - The
OAuthAPI only supports public clients, i.e. clients without a secret. (#4634)OAuth::restore_registered_client()takes aClientIdinstead ofClientCredentialsOAuth::restore_registered_client()must NOT be called afterOAuth::register_client()anymore.
Oidc::authorize_scope()was removed because it has no use case anymore, according to the latest version of MSC2967. (#4664)- The
OAuthAPI uses theGET /auth_metadataendpoint from the latest version of MSC2965 by default. The previousGET /auth_issuerendpoint is still supported as a fallback for now. (#4673)- It is not possible to provide a custom issuer anymore:
Oidc::given_provider_metadata()was removed, and the parameter was removed fromOAuth::register_client(). Oidc::fetch_authentication_issuer()was removed. To check if the homeserver supports OAuth 2.0, useOAuth::server_metadata().OAuth::server_metadata()returns anOAuthDiscoveryError. It has aNotSupportedvariant and anis_not_supported()method to check if the error is due to the server not supporting OAuth 2.0.OAuthError::MissingAuthenticationIssuerwas removed.
- It is not possible to provide a custom issuer anymore:
- The behavior of
OAuth::logout()is now aligned with MSC4254 (#4674)- Support for RP-Initiated Logout
was removed, so it doesn't return an
OidcEndSessionUrlBuilderanymore. - Only one request is made to revoke the access token, since the server is supposed to revoke both the access token and the associated refresh token when the request is made.
- Support for RP-Initiated Logout
was removed, so it doesn't return an
- Remove most of the parameter methods of
OAuthAuthCodeUrlBuilder, since they were parameters defined in OpenID Connect. Only thepromptanduser_id_hintparameters are still supported. (#4699) - Remove support for ID tokens in the
OAuthAPI. (#4726)OAuth::restore_registered_client()doesn't take aVerifiedClientMetadataanymore.Oidc::latest_id_token()andOidc::client_metadata()were removed.
- The
OAuthAPI makes use of the oauth2 and ruma crates rather than mas-oidc-client. (#4761) (#4789)ClientIdis a different type reexported from the oauth2 crate.- The error types that were in the
oauthmodule have been moved to theoauth::errormodule. - The
device_idparameter ofOAuth::loginis now anOption<OwnedDeviceId>. - The
statefield ofOAuthAuthorizationDataand the parameter of the same name inOAuth::abort_login()now useCsrfToken. - The
typesandrequestsmodules are gone and the necessary types are exported from theoauthmodule or available fromruma. AccountManagementUrlFullnow takes anOwnedDeviceIdwhen a device ID is required.(Verified)ProviderMetadatawas replaced byAuthorizationServerMetadata.OAuth::register_client()doesn't accept a software statement anymore.(Verified)ClientMetadatawas replaced byRaw<ClientMetadata>.ClientMetadatais an opinionated type that only supports the fields required for theOAuthAPI, however any type can be used to construct the metadata by serializing it to JSON and converting it.
OAuth::finish_login()must always be called, instead ofOAuth::finish_authorization()(#4817)OAuth::abort_authorization()was renamed toOAuth::abort_login().OAuth::finish_login()can be called several times for the same session, but it will return an error if it is called with a new session.OAuthError::MissingDeviceIdwas removed, it cannot occur anymore.
- Allow to use any registration method with
OAuth::login()andOAuth::login_with_qr_code(). (#4827)OAuth::logintakes an optionalClientRegistrationDatato be able to register and login with a single function call.OAuth::url_for_oidc()was removed, it can be replaced by a call toOAuth::login().OAuth::login_with_qr_code()takes an optionalClientRegistrationDatainstead of the client metadata.OAuth::finish_logintakes aUrlOrQueryinstead of anAuthorizationCode. The deserialization of the query string will occur inside the method and eventual errors will be handled.OAuth::login_with_oidc_callback()was removed, it can be replaced by a call toOAuth::finish_login().AuthorizationResponse,AuthorizationCodeandAuthorizationErrorare now private.
OAuth::account_management_url()andOAuth::fetch_account_management_url()don't take an action anymore but return anAccountManagementUrlBuilder. The final URL can be obtained withAccountManagementUrlBuilder::build(). (#4831)OidcRegistrationswas removed. Clients are supposed to re-register with the homeserver for every login. (#4879)OAuth::restore_registered_client()doesn't take anissueranymore. (#4879)Oidc::issuer()was removed.- The
issuerfield ofUserSessionwas removed.
- Rename the
SendHandle::media_handleswas generalized into a vector (#4898)
[0.10.0] - 2025-02-04
Features
-
Allow to set and check whether an image is animated via its
ImageInfo. (#4503) -
Implement
DefaultforBaseImageInfo,BaseVideoInfo,BaseAudioInfoandBaseFileInfo. (#4503) -
Expose
Client::server_versions()publicly to allow users of the library to get the versions of Matrix supported by the homeserver. (#4519) -
Create
RoomPrivacySettingshelper to group room settings functionality related to room access and visibility. (#4401) -
Enable HTTP/2 support in the HTTP client. (#4566)
-
Add support for creating custom conditional push rules in
NotificationSettings::create_custom_conditional_push_rule. (#4587) -
The media contents stored in the media cache can now be controlled with a
MediaRetentionPolicyand the newMediamethodsmedia_retention_policy(),set_media_retention_policy(),clean_up_media_cache(). (#4571) -
Add support for creating custom conditional push rules in
NotificationSettings::create_custom_conditional_push_rule. (#4587)
Refactor
-
[breaking]: The
RoomEventCacheUpdate::Clearvariant has been removed, as it is redundant with theRoomEventCacheUpdate::UpdateTimelineEvents { diffs: Vec<VectorDiff<_>>, .. }whereVectorDiffhas its ownClearvariant. (#4627) -
Improve the performance of
EventCache(approximately 4.5 times faster). (#4616) -
[breaking]: The reexported types
SyncTimelineEventandTimelineEventhave been fused into a single typeTimelineEvent, and its fieldpush_actionshas been madeOptional (it is set toNonewhen we couldn't compute the push actions, because we lacked some information). (#4568) -
[breaking] Move the optional
RequestConfigargument of theClient::send()method to thewith_request_config()builder method. You should callClient::send(request).with_request_config(request_config).awaitnow instead. (#4443) -
[breaking] Remove the
AttachmentConfig::with_thumbnail()constructor and replace it with theAttachmentConfig::thumbnail()builder method. You should callAttachmentConfig::new().thumbnail(thumbnail)now instead. (#4452) -
[breaking]
Room::send_attachment()andRoomSendQueue::send_attachment()now take any type that implementsInto<String>for the filename. (#4451) -
[breaking]
Recovery::are_we_the_last_man_standing()has been renamed tois_last_device(). (#4522) -
[breaking] The
matrix_authmodule is now atauthentication::matrix. (#4575) -
[breaking] The
oidcmodule is now atauthentication::oidc. (#4575)
[0.9.0] - 2024-12-18
Bug Fixes
-
Use the inviter's server name and the server name from the room alias as fallback values for the via parameter when requesting the room summary from the homeserver. This ensures requests succeed even when the room being previewed is hosted on a federated server. (#4357)
-
Do not use the encrypted original file's content type as the encrypted thumbnail's content type. (#ecf4434)
Features
-
Enable persistent storage for the
EventCache. This allows events received through the/syncendpoint or backpagination to be stored persistently, enabling client applications to restore a room's view, including events, without requiring server communication. (#4347) -
[breaking] Make all fields of Thumbnail required (#4324)
-
Backups::exists_on_server, which always fetches up-to-date information from the server about whether a key storage backup exists, was renamed tofetch_exists_on_the_server, and a new implementation ofexists_on_serverwhich caches the most recent answer is now provided.
[0.8.0] - 2024-11-19
Bug Fixes
-
Add more invalid characters for room aliases.
-
Match the right status code in
Client::is_room_alias_available. -
Fix a bug where room keys were considered to be downloaded before backups were enabled. This bug only affects the
BackupDownloadStrategy::AfterDecryptionFailure, where no attempt would be made to download a room key, if a decryption failure with a given room key would have been encountered before the backups were enabled.
Documentation
- Improve documentation of
Client::observe_events.
Features
-
Add
create_room_aliasfunction. -
Client::cross_process_store_locks_holder_nameis used everywhere: -
StoreConfig::new()now takes across_process_store_locks_holder_nameargument. -
StoreConfigno longer implementsDefault. -
BaseClient::new()has been removed. -
BaseClient::clone_with_in_memory_state_store()now takes across_process_store_locks_holder_nameargument. -
BaseClientno longer implementsDefault. -
EventCacheStoreLock::new()no longer takes akeyargument. -
BuilderStoreConfigno longer hascross_process_store_locks_holder_namefield forSqliteandIndexedDb. -
EncryptionSyncServiceandNotificationare usingClient::cross_process_store_locks_holder_name. -
Allow passing a custom
RequestConfigto an upload request. -
Retry uploads if they've failed with transient errors.
-
Implement
EventHandlerContextfor tuples. -
Introduce a mechanism similar to
Client::add_event_handlerandClient::add_room_event_handlerbut with a reactive programming pattern. AddClient::observe_eventsandClient::observe_room_events.
// Get an observer.
let observer =
client.observe_events::<SyncRoomMessageEvent, (Room, Vec<Action>)>();
// Subscribe to the observer.
let mut subscriber = observer.subscribe();
// Use the subscriber as a `Stream`.
let (message_event, (room, push_actions)) = subscriber.next().await.unwrap();
When calling observe_events, one has to specify the type of event (in the
example, SyncRoomMessageEvent) and a context (in the example, (Room, Vec<Action>), respectively for the room and the push actions).
-
Implement unwedging for media uploads.
-
Send state from state sync and not from timeline to widget (#4254)
-
Allow aborting media uploads.
-
Add
RoomPreviewInfo::num_active_members. -
Use room directory search as another data source.
-
Check if the user is allowed to do a room mention before trying to send a call notify event. (#4271)
-
Add
Client::cross_process_store_locks_holder_name(). -
Add a
PreviouslyVerifiedvariant toVerificationLevelindicating that the identity is unverified and previously it was verified. -
New
UserIdentity::pinmethod. -
New
ClientBuilder::with_decryption_trust_requirementmethod. -
New
ClientBuilder::with_room_key_recipient_strategymethod -
New
Room.set_account_dataandRoom.set_account_data_rawRoomAccountData setters, analogous to the GlobalAccountData -
New
RequestConfig.max_concurrent_requestswhich allows to limit the maximum number of concurrent requests the internal HTTP client issues (all others have to wait until the number drops below that threshold again) -
Implement proper redact handling in the widget driver. This allows the Rust SDK widget driver to support widgets that rely on redacting.
Refactor
-
[breaking] Rename
DisplayNametoRoomDisplayName. -
Improve
is_room_alias_format_validso it's more strict. -
Remove duplicated fields in media event contents.
-
Use
SendHandlefor media uploads too. -
Move
event_cache_store/toevent_cache/store/inmatrix-sdk-base. -
Move
linked_chunkfrommatrix-sdktomatrix-sdk-common. -
Move
EventandGapintomatrix_sdk_base::event_cache. -
Move
formatted_caption_fromto the SDK, rename it. -
Tidy up and start commenting the widget code.
-
Get rid of
ProcessingContextand inline it in its callers. -
Get rid of unused
limitsparameter when constructing aWidgetMachine. -
Use a specialized mutex for locking access to the state store and
being_sent. -
Renamed
VerificationLevel::PreviouslyVerifiedtoVerificationLevel::VerificationViolation. -
[breaking] Replace the
Notificationtype from Ruma inSyncResponseandClient::register_notification_handlerby a custom one. -
[breaking] The ambiguity maps in
SyncResponseare moved toJoinedRoomandLeftRoom. -
[breaking]
Room::can_user_redactandMember::can_redactare split between*_redact_ownand*_redact_other. -
[breaking]
AmbiguityCachecontains the room member's user ID. -
[breaking] Replace
impl MediaEventContentwith&impl MediaEventContentinMedia::get_file/Media::remove_file/Media::get_thumbnail/Media::remove_thumbnail -
[breaking] A custom sliding sync proxy set with
ClientBuilder::sliding_sync_proxynow takes precedence over a discovered proxy. -
[breaking]
Client::get_profilewas moved toAccountand renamed toAccount::fetch_user_profile_of.Account::get_profilewas renamed toAccount::fetch_user_profile. -
[breaking] The
HttpError::UnableToCloneRequesterror variant has been removed because it was never used or generated by the SDK. -
[breaking] The
Error::InconsistentStateerror variant has been removed because it was never used or generated by the SDK. -
[breaking] The widget capabilities in the FFI now need two additional flags:
update_delayed_event,send_delayed_event. -
[breaking]
Room::eventnow takes an optionalRequestConfigto allow for tweaking the network behavior. -
[breaking] The
instantmodule was removed, use theruma::timemodule instead. -
[breaking] Add
ClientBuilder::sqlite_store_with_cache_pathto build a client that stores caches in a different directory to state/crypto. -
[breaking] The
bodyparameter inget_media_filehas been replaced with afilenameparameter now that Ruma has afilename()method.
0.7.0
Breaking changes:
- The
Client::sync_tokenaccessor function is no longer public. If you were using this forClient::sync_once(), you can get the token from the result of theClient::sync_once()method instead (#1216). Common::membersandCommon::members_no_synctake aRoomMembershipsto be able to filter the results by any membership state.Common::active_members(_no_sync)andCommon::joined_members(_no_sync)are deprecated.
matrix-sdk-sqliteis the new default store implementation outside of WASM, behind thesqlitefeature.- The
sledfeature was removed. Thematrix-sdk-sledcrate is deprecated and no longer maintained.
- The
- Replace
Client::authentication_issuerwithClient::authentication_server_infothat contains all the fields discovered from the homeserver for authenticating with OIDC - Remove
HttpSendtrait in favor of allowing a customreqwest::Clientinstance to be supplied - Move all the types and methods using the native Matrix login and registration APIs from
Clientto the newmatrix_auth::MatrixAuthAPI that is accessible viaClient::matrix_auth(). - Move
SessionandSessionTokensto thematrix_authmodule.- Move the session methods on
Clientto theMatrixAuthAPI. - Split
Session's content into several types. Its (de)serialization is still backwards compatible.
- Move the session methods on
- The room API has been simplified
- Removed the previous
Room,Joined,InvitedandLefttypes - Merged all of the functionality from
Joined,InvitedandLeftintoroom::Common - Renamed
room::Commonto justRoomand made it accessible asmatrix_sdk::Room
- Removed the previous
- Event handler closures now need to implement
FnOnce+Cloneinstead ofFn- As a consequence, you no longer need to explicitly need to
clonevariables they capture before constructing anasync move {}block inside
- As a consequence, you no longer need to explicitly need to
Room::sync_membersdoesn't return the underlying Ruma response anymore. If you need to get the room members, you can useRoom::membersorRoom::get_memberwhich will make sure that the members are up to date.- The
transaction_idparameter ofRoom::{send, send_raw}was removed- Instead, both methods now return types that implement
IntoFuture(so can be awaited like before) and have awith_transaction_idbuilder-style method
- Instead, both methods now return types that implement
- The parameter order of
Room::{send_raw, send_state_event_raw}has changed,contentis now last- The parameter type of
contenthas also changed to a generic;serde_json::Valuearguments are still allowed, but so are other types likeBox<serde_json::value::RawValue>
- The parameter type of
- All "named futures" (structs implementing
IntoFuture) are now exported from modules namedfuturesinstead of directly in the respective parent module Verificationis non-exhaustive, to make theqrcodecargo feature additive
Bug fixes:
Client::roomsnow returns all rooms, even invited, as advertised.
Additions:
-
Add secret storage support, the secret store can be opened using the
Client::encryption()::open_secret_store()method, which allows you to import or export secrets from the account-data backed secret-store. -
Add
VerificationRequest::stateandVerificationRequest::changesto check and listen to changes in the state of theVerificationRequest. This removes the need to listen to individual matrix events once theVerificationRequestobject has been acquired. -
The
Roommethods to retrieve state events can now return a sync or stripped event, so they can be used for invited rooms too. -
Add
Client::subscribe_to_room_updatesandroom::Common::subscribe_to_updates -
Add
Client::rooms_filtered -
Add methods on
Clientthat can handle several authentication APIs. -
Add new method
force_discard_sessiononRoomthat allows to discard the current outbound session (room key) for that room. Can be used by clients for the/discardsessioncommand.
0.6.2
- Fix the access token being printed in tracing span fields.
0.6.1
- Fixes a bug where the access token used for Matrix requests was added as a field to a tracing span.