Releases: matrix-org/matrix-rust-sdk
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.
matrix-sdk 0.8.0
What's Changed
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_alias
function. -
Client::cross_process_store_locks_holder_name
is used everywhere: -
StoreConfig::new()
now takes a
cross_process_store_locks_holder_name
argument. -
StoreConfig
no longer implementsDefault
. -
BaseClient::new()
has been removed. -
BaseClient::clone_with_in_memory_state_store()
now takes a
cross_process_store_locks_holder_name
argument. -
BaseClient
no longer implementsDefault
. -
EventCacheStoreLock::new()
no longer takes akey
argument. -
BuilderStoreConfig
no longer has
cross_process_store_locks_holder_name
field forSqlite
and
IndexedDb
. -
EncryptionSyncService
andNotification
are usingClient::cross_process_store_locks_holder_name
. -
Allow passing a custom
RequestConfig
to an upload request. -
Retry uploads if they've failed with transient errors.
-
Implement
EventHandlerContext
for tuples. -
Introduce a mechanism similar to
Client::add_event_handler
and
Client::add_room_event_handler
but with a reactive programming pattern. Add
Client::observe_events
andClient::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
PreviouslyVerified
variant toVerificationLevel
indicating that the
identity is unverified and previously it was verified. -
New
UserIdentity::pin
method. -
New
ClientBuilder::with_decryption_trust_requirement
method. -
New
ClientBuilder::with_room_key_recipient_strategy
method -
New
Room.set_account_data
andRoom.set_account_data_raw
RoomAccountData
setters, analogous to the GlobalAccountData -
New
RequestConfig.max_concurrent_requests
which 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
DisplayName
toRoomDisplayName
. -
Improve
is_room_alias_format_valid
so it's more strict. -
Remove duplicated fields in media event contents.
-
Use
SendHandle
for media uploads too. -
Move
event_cache_store/
toevent_cache/store/
inmatrix-sdk-base
. -
Move
linked_chunk
frommatrix-sdk
tomatrix-sdk-common
. -
Move
Event
andGap
intomatrix_sdk_base::event_cache
. -
Move
formatted_caption_from
to the SDK, rename it. -
Tidy up and start commenting the widget code.
-
Get rid of
ProcessingContext
and inline it in its callers. -
Get rid of unused
limits
parameter when constructing aWidgetMachine
. -
Use a specialized mutex for locking access to the state store and
being_sent
. -
Renamed
VerificationLevel::PreviouslyVerified
to
VerificationLevel::VerificationViolation
. -
[breaking] Replace the
Notification
type from Ruma inSyncResponse
and
Client::register_notification_handler
by a custom one. -
[breaking] The ambiguity maps in
SyncResponse
are moved toJoinedRoom
andLeftRoom
. -
[breaking]
Room::can_user_redact
andMember::can_redact
are split
between*_redact_own
and*_redact_other
. -
[breaking]
AmbiguityCache
contains the room member's user ID. -
[breaking] Replace
impl MediaEventContent
with&impl MediaEventContent
in
Media::get_file
/Media::remove_file
/Media::get_thumbnail
/Media::remove_thumbnail
-
[breaking] A custom sliding sync proxy set with
ClientBuilder::sliding_sync_proxy
now takes precedence over a discovered
proxy. -
[breaking]
Client::get_profile
was moved toAccount
and renamed to
Account::fetch_user_profile_of
.Account::get_profile
was renamed to
Account::fetch_user_profile
. -
[breaking] The
HttpError::UnableToCloneRequest
error variant has been
removed because it was never used or generated by the SDK. -
[breaking] The
Error::InconsistentState
error 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::event
now takes an optionalRequestConfig
to allow
for tweaking the network behavior. -
[breaking] The
instant
module was removed, use theruma::time
module
instead. -
[breaking] Add
ClientBuilder::sqlite_store_with_cache_path
to build a
client that stores caches in a different directory to state/crypto. -
[breaking] The
body
parameter inget_media_file
has been replaced with
afilename
parameter now that Ruma has afilename()
method.
matrix-sdk-crypto-ffi-0.4.3
Production-ready version of iOS Crypto SDK, containing precompiled matrix-sdk-crypto-ffi Apple framework.
- Exposed PKEncryption APIs directly from vodozemac
matrix-sdk-crypto 0.7.2
What's Changed
Security Fixes
- Fix
UserIdentity::is_verified
to take into account our own identity #d8d9dae (Moderate, GHSA-4qg4-cvh2-crgg).
matrix-sdk-crypto-ffi-0.4.2
Production-ready version of iOS Crypto SDK, containing precompiled matrix-sdk-crypto-ffi Apple framework.
Changes:
FFI Bindings: Expose CryptoStore clear caches
matrix-sdk-crypto-ffi-0.4.1
Production-ready version of iOS Crypto SDK, containing precompiled matrix-sdk-crypto-ffi Apple framework.
Contains some breaking changes