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_level
method.
(#5635) (Low, CVE-2025-59047, GHSA-qhj8-q5r6-8q6j).
matrix-sdk 0.14.0
What's Changed
Features
-
Client::fetch_thread_subscriptions
implements 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_rooms
method that allows retrieving the list of joined spaces. -
Room::enable_encryption
andRoom::enable_encryption_with_state_event_encryption
will 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_state
to enable E2E encryption with encrypted state event support, gated behind theexperimental-encrypted-state-events
feature.
(#5557) -
Add
ignore_timeout_on_first_sync
to theSyncSettings
, which should allow to have a quicker first response when using one of thesync
,sync_with_callback
,sync_with_result_callback
orsync_stream
methods onClient
, if the response is empty.
(#5481) -
The methods to use the
/v3/sync
endpoint set theuse_state_after
field, 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]
RoomMemberRole
has a newCreator
variant, that differentiates room creators with infinite power levels, as introduced in room version 12.
(#5436) -
Add
Account::fetch_account_data_static
to 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::login
now allows requesting additional scopes for the authorization code grant.
(#5395)
Refactor
- [breaking] Upgrade ruma to 0.13.0
(#5623) - [breaking]
SyncSettings
token is nowSyncToken
enum type which has default behaviour ofSyncToken::ReusePrevious
token. This breaksClient::sync_once
. For old behaviour, set the token toSyncToken::NoToken
with the usualSyncSettings::token
setter. - [breaking] Change the upload_encrypted_file and make it clone the client instead of owning it. The lifetime of the
UploadEncryptedFile
request returned byClient::upload_encrypted_file()
only depends on the request lifetime now. - [breaking] Add an
IsPrefix = False
bound 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 useUserPowerLevel
to represent power levels instead ofi64
to differentiate the infinite power level of creators, as introduced in room version 12.
(#5436) - [breaking] The
reason
argument ofRoom::report_room()
is now required, due to a clarification in the spec.
(#5337) - [breaking] The
join_rule
field ofRoomPreview
is now aJoinRuleSummary
. It has the same variants asSpaceRoomJoinRule
but 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_notification
andRoom::send_call_notification_if_needed
have been removed, since the event type they send is outdated, andClient
is 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_timeout
of 60s, which means they'll disconnect if the connection stalls.
RequestConfig::timeout
is 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_invite
enabled,
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_device
Now supports sending encrypted to-device messages.
(#5252)Client::add_event_handler
: SetOption<EncryptionInfo>
inEventHandlerData
for to-device messages.
If the to-device message was encrypted, theEncryptionInfo
will be set. If it isNone
the message was sent in clear.
(#5099)EventCache::subscribe_to_room_generic_updates
is 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
header
url parameter
instead of the now deprecatedhideHeader
parameter. This is only compatible with EC v0.13.0 or newer. - [breaking]
RoomEventCacheGenericUpdate
gains a newClear
variant, and sees
itsTimelineUpdated
variant 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/versions
endpoint.
(#5357) ClientServerCapabilities
has been renamed toClientServerInfo
. Alongside this,
Client::reset_server_info
is nowClient::reset_server_info
andClient::fetch_server_capabilities
is nowClient::fetch_server_versions
, returning the server versions response directly.
(#5167)RoomEventCacheListener
is renamedRoomEventCacheSubscriber
(#5269)RoomPreview::join_rule
is now optional, and will be set toNone
if the join rule state event
is missing for a given room.
(#5278)
Bug fixes
m.room.avatar
has 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_needed
now returnsResult<bool>
instead ofResult<()>
so we can check if
the event was sent.- Added
SendMediaUploadRequest
wrapper forSendRequest
, which checks the size of the request to
upload making sure it doesn't exceed them.upload.size
value that can be fetched through
Client::load_or_fetch_max_upload_size
. - Add
ClientBuilder::with_enable_share_history_on_invite
to 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_unread
room account data, which was
stabilized in Matrix 1.12.Room::is_marked_unread()
also ignores the unstable
com.famedly.marked_unread
room 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-device
flag, 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_gallery
has been added to allow sending MSC4274-style media galleries
via the send queue under theunstable-msc4274
feature.
(#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
520
won'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_context
now 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::PushContext
parameter to
compute the push notifications for the decrypted event.
(#4962)SlidingSyncRoom
has been removed. With it, theSlidingSync::get_room
,
get_all_rooms
,get_rooms
,get_number_of_rooms
, and
FrozenSlidingSync
methods 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_changes
returns 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_raw
allows 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_key
event 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 andPickledInboundGroupSession
has received a new
shared_history
field that defaults tofalse.
(#4700) -
Have the
RoomIdentityProvider
return processing changes when identities transition
toIdentityState::Verified
too.
(#4670) -
[breaking]
CollectStrategy::DeviceBasedStrategy
is now split into three
separate strategies (AllDevices
,ErrorOnVerifiedUserProblem
,
OnlyTrustedDevices
), to make the behaviour clearer.
(#4581) -
Accept stable identifier
sender_device_keys
for 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_key
and
DehydratedDevices::delete_dehydrated_device_pickle_key
to 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_upload
and
DehydratedDevices::rehydrate
now use theDehydratedDeviceKey
as parameter
instead of a raw byte array. UseDehydratedDeviceKey::from_bytes
to migrate.
(#4383) -
Add extra logging in
OtherUserIdentity::pin_current_master_key
and
OtherUserIdentity::withdraw_verification
.
(#4415) -
Added new
UtdCause
variantsWithheldForUnverifiedOrInsecureDevice
andWithheldBySender
.
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) -
UtdCause
has two new variants that replace the existingHistoricalMessage
:
HistoricalMessageAndBackupIsDisabled
andHistoricalMessageAndDeviceIsUnverified
.
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
/room
to the base domain. For backward compatibility
the app itself would need to add/room
to theelement_call_url
. - And replaced:
analytics_id
->posthog_user_id
(The widget URL query parameters will
includeanalytics_id
&posthog_user_id
for backward compatibility)skip_lobby
->intent
(Intent.StartCall
,Intent.JoinExisting
.
The widget URL query parameters will includeskip_lobby
ifintent
is
Intent.StartCall
for backward compatibility)
VirtualElementCallWidgetOptions
now implementsDefault
.
(#4822)
- It supports the new fields:
-
[breaking]: The
RoomPagination::run_backwards
method 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_url
method 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_url
method can be used.
(#4663) -
The
MediaRetentionPolicy
can now trigger regular cleanups with its new
cleanup_frequency
setting.
(#4603) -
[breaking] The HTTP client only allows TLS 1.2 or newer, as recommended by
BCP 195.
(#4647) -
Add
Room::report_room
api. (#4713) -
Client::notification_client
will 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
NotificationProcessSetup
wasSingleSetup
. -
[breaking]
Room::is_encrypted
is replaced by
Room::latest_encryption_state
which returns a value of the new
EncryptionState
enum; anotherRoom::encryption_state
non-async and
infallible method is added to get theEncryptionState
without 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-server
feature, can be used to spawn
a server when the end-user needs to be redirected to an address on localhost.
It was used forSsoLoginBuilder
and can now be used in other cases, like for
login with the OAuth 2.0 API.
(#4804) -
The
OAuth
api is no longer gated behind theexperimental-oidc
cargo
feature.
(#4830) -
Re-export
SqliteStoreConfig
and add
ClientBuilder::sqlite_store_with_config_and_cache_path
to configure the
SQLite store with the newSqliteStoreConfig
structure
(#4870) -
Add
Client::logout()
that allows to log out regardless of theAuthApi
that
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
OAuth
API 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_limit
method was
renamed toRequestConfig::max_retry_time
and the parameter for the method was
updated from au64
to 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_url
andserver_response
methods of
SsoLoginBuilder
are replaced byserver_builder()
, which allows more
fine-grained settings for the server.
(#4804 - [breaking]:
OidcSessionTokens
andMatrixSessionTokens
have 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 inOidcRegistrations
is 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_url
andserver_response
methods of
SsoLoginBuilder
are replaced byserver_builder()
, which allows more
fine-grained settings for the server. - [breaking]: Rename the
Oidc
API toOAuth
, since it's using almost
exclusively OAuth 2.0 rather than OpenID Connect.
(#4805)- The
oidc
module was renamed tooauth
. Client::oidc()
was renamed toClient::oauth()
and theAuthApi::Oidc
variant was renamed toAuthApi::OAuth
.OidcSession
was renamed toOAuthSession
and theAuthSession::Oidc
variant was renamed toAuthSession::OAuth
.OidcAuthCodeUrlBuilder
andOidcAuthorizationData
were renamed to
OAuthAuthCodeUrlBuilder
andOAuthAuthorizationData
.OidcError
was renamed toOAuthError
and 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::MissingDeviceId
was removed, it cannot occur anymore.
- [breaking]
OidcRegistrations
was renamed toOAuthRegistrationStore
.
(#4814)OidcRegistrationsError
was renamed toOAuthRegistrationStoreError
.- The
registrations
module was renamed and is now private.
OAuthRegistrationStore
andClientId
are exported fromoauth
, and
OAuthRegistrationStoreError
is exported fromoauth::error
. - All the methods of
OAuthRegistrationStore
are nowasync
and 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 aPathBuf
instead 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::login
takes an optionalClientRegistrationData
to 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_login
takes aUrlOrQuery
instead 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
,AuthorizationCode
andAuthorizationError
are
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
Default
forBaseImageInfo
,BaseVideoInfo
,BaseAudioInfo
and
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
RoomPrivacySettings
helper 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
MediaRetentionPolicy
and the newMedia
methodsmedia_retention_policy()
,
set_media_retention_policy()
,clean_up_media_cache()
.
(#4571)
Refactor
- [breaking]: The reexported types
SyncTimelineEvent
andTimelineEvent
have been fused into a single typeTimelineEvent
, and its fieldpush_actions
has been madeOption
al (it is set toNone
when we couldn't compute the push actions, because we lacked some information).
(#4568) - [breaking] Move the optional
RequestConfig
argument 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_auth
module is now atauthentication::matrix
.
(#4575) - [breaking] The
oidc
module 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/sync
endpoint 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.