Releases: matrix-org/matrix-rust-sdk
matrix-sdk-base 0.14.1
What's Changed
Security Fixes
- Fix a panic in the
RoomMember::normalized_power_levelmethod.
(#5635) (Low, CVE-2025-59047, GHSA-qhj8-q5r6-8q6j).
matrix-sdk 0.14.0
What's Changed
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)
matrix-sdk 0.13.0
What's Changed
Security Fixes
- Fix SQL injection vulnerability in
EventCache
(d0c0100, Moderate, CVE-2025-53549, GHSA-275g-g844-73jh)
Bug fixes
- 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()and
Client::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)
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) ClientServerCapabilitieshas been renamed toClientServerInfo. Alongside this,
Client::reset_server_infois nowClient::reset_server_infoandClient::fetch_server_capabilities
is 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)
matrix-sdk-crypto-ffi-0.11.1
What's Changed
Security Fixes
- Check the sender of an event matches owner of session, preventing sender spoofing by homeserver owners.
13c1d20 (High, CVE-2025-48937, GHSA-x958-rvg6-956w).
Bug Fixes
matrix-sdk-crypto 0.11.1
What's Changed
Security Fixes
- Check the sender of an event matches owner of session, preventing sender spoofing by homeserver owners.
13c1d20 (High, CVE-2025-48937, GHSA-x958-rvg6-956w).
Bug Fixes
matrix-sdk 0.12.0
What's Changed
Security Fixes
- Check the sender of an event matches owner of session, preventing sender spoofing by homeserver owners.
13c1d20 (High, CVE-2025-48937, GHSA-x958-rvg6-956w).
Features
Client::send_call_notification_if_needednow returnsResult<bool>instead ofResult<()>so we can check if
the event was sent.- 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 through
Client::load_or_fetch_max_upload_size. - 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.
(#4972)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.
(#4972)- 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 as
EventCache::subscribe()has been called (which happens automatically if you're using the
matrix_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 unstable
com.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 the
experimental-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
Room::push_context()has been renamed intoRoom::push_condition_room_ctx(). The newer
Room::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, and
FrozenSlidingSyncmethods 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)
matrix-sdk-crypto-ffi-0.11.0
Features
-
[breaking]
OlmMachine.receive_sync_changesreturns now a list ofProcessedToDeviceEvent
instead of a list ofRaw<AnyToDeviceEvent>. With variants likeDecrypted|UnableToDecrypt|PlainText|NotProcessed.
This allows for example to make the difference between an event sent in clear and an event successfully decrypted.
For quick compatibility a helperProcessedToDeviceEvent::to_rawallows to map back to the previous behaviour. -
[breaking] Add support for the shared history flag defined in
MSC3061.
The shared history flag is now respected when room keys are received as an
m.room_keyevent as well as when they are imported from a backup or a file
export. We also ensure to set the flag when we send out room keys. Due to
this, a new argument to the constructor forroom_key::MegolmV1AesSha2Content
has been added andPickledInboundGroupSessionhas received a new
shared_historyfield that defaults tofalse.
(#4700) -
Have the
RoomIdentityProviderreturn processing changes when identities transition
toIdentityState::Verifiedtoo.
(#4670) -
[breaking]
CollectStrategy::DeviceBasedStrategyis now split into three
separate strategies (AllDevices,ErrorOnVerifiedUserProblem,
OnlyTrustedDevices), to make the behaviour clearer.
(#4581) -
Accept stable identifier
sender_device_keysfor MSC4147 (Including device
keys with Olm-encrypted events).
(#4420) -
Room keys are not shared with unsigned dehydrated devices.
(#4551) -
[breaking] Expose new API
DehydratedDevices::get_dehydrated_device_pickle_key,
DehydratedDevices::save_dehydrated_device_pickle_keyand
DehydratedDevices::delete_dehydrated_device_pickle_keyto store/load the
dehydrated device pickle key. This allows client to automatically rotate
the dehydrated device to avoid one-time-keys exhaustion and to_device
accumulation.
DehydratedDevices::keys_for_uploadand
DehydratedDevices::rehydratenow use theDehydratedDeviceKeyas parameter
instead of a raw byte array. UseDehydratedDeviceKey::from_bytesto migrate.
(#4383) -
Add extra logging in
OtherUserIdentity::pin_current_master_keyand
OtherUserIdentity::withdraw_verification.
(#4415) -
Added new
UtdCausevariantsWithheldForUnverifiedOrInsecureDeviceandWithheldBySender.
These variants provide clearer categorization for expected Unable-To-Decrypt (UTD) errors
when the sender either did not wish to share or was unable to share the room_key.
(#4305) -
UtdCausehas two new variants that replace the existingHistoricalMessage:
HistoricalMessageAndBackupIsDisabledandHistoricalMessageAndDeviceIsUnverified.
These give more detail about what went wrong and allow us to suggest to users
what actions they can take to fix the problem. See the doc comments on these
variants for suggested wording.
(#4384)
matrix-sdk 0.11.0
What's Changed
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_lobbyifintentis
Intent.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 new
cleanup_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 if
NotificationProcessSetupwasSingleSetup. -
[breaking]
Room::is_encryptedis replaced by
Room::latest_encryption_statewhich returns a value of the new
EncryptionStateenum; anotherRoom::encryption_statenon-async and
infallible method is added to get theEncryptionStatewithout calling
Room::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 add
ClientBuilder::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, theRequestConfig::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 of
SsoLoginBuilderare 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 by
Client::subscribe_to_session_changes()and then calling
Client::session_tokens()on aSessionChange::TokenRefreshed.
(#4772) - [breaking]
Oidc::url_for_oidc()doesn't take theVerifiedClientMetadata
to 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 of
SsoLoginBuilderare 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::Oidc
variant was renamed toAuthApi::OAuth.OidcSessionwas renamed toOAuthSessionand theAuthSession::Oidc
variant was renamed toAuthSession::OAuth.OidcAuthCodeUrlBuilderandOidcAuthorizationDatawere renamed to
OAuthAuthCodeUrlBuilderandOAuthAuthorizationData.OidcErrorwas renamed toOAuthErrorand theRefreshTokenError::Oidc
variant 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, and
OAuthRegistrationStoreErroris exported fromoauth::error. - All the methods of
OAuthRegistrationStoreare nowasyncand return a
Result: 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_registrations
parameter. It should be provided if needed with
OAuthRegistrationStore::with_static_registrations().
- [breaking] Allow to use any registration method with
OAuth::login()and
OAuth::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 to
OAuth::login().OAuth::login_with_qr_code()takes an optionalClientRegistrationData
instead of the client metadata.OAuth::finish_logintakes aUrlOrQueryinstead of an
AuthorizationCode. 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.
- [**break...
matrix-sdk 0.10.0
What's Changed
Features
- Allow to set and check whether an image is animated via its
ImageInfo.
(#4503) - Implement
DefaultforBaseImageInfo,BaseVideoInfo,BaseAudioInfoand
BaseFileInfo.
(#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) - 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)
Refactor
- [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 the
Client::send()method to thewith_request_config()builder method. You
should callClient::send(request).with_request_config(request_config).await
now 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)
matrix-sdk 0.9.0
What's Changed
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 to
fetch_exists_on_the_server, and a new implementation ofexists_on_server
which caches the most recent answer is now provided.