Commit Graph

2150 Commits

Author SHA1 Message Date
Jorge Martin Espinosa 306e1cb950 Upgrade SDK bindings to v26.09.26 (#7780)
* Bump SDK bindings to `v26.09.26`

This version contains a fix for issues in `v26.09.25` related to certificate verification.

* Fix breaking API changes in the latest bindings

* Unify `FeatureFlags.RoomThreadList` with `FeatureFlags.Threads`
2026-09-25 16:08:19 +02:00
Jorge Martin Espinosa 8b1b5560d9 Add recent search results to global search (#7742)
* Add global search results history: keep the latest 25 items used in the global search, save them to an encrypted file store.

* Integrate the search history in the global search feature

* Add `MatrixClient.getRoomInfo` and use it in `GlobalSearchPresenter`

---------

Co-authored-by: ElementBot <android@element.io>
2026-09-22 15:17:57 +00:00
Jorge Martin Espinosa 3c3e8f8f6f Start sync manually after completing the auth flow (#7734)
Do it before we wait for the known verification state so we can receive updates from the encryption sliding sync flow.
2026-09-21 14:34:34 +02:00
Benoit Marty c92bf4bc43 Sealed interface must be immutable when uses in Composable function parameters. 2026-09-15 09:11:40 +02:00
Benoit Marty 5b0d7bf5a7 Log errors and fix quality issues 2026-09-14 18:30:29 +02:00
Benoit Marty 6887092ce4 Replace String by AccountProvider to be able to get baseUrl and serverName. 2026-09-14 09:56:16 +02:00
Jorge Martin Espinosa 8cd3750cde Make global search use a Joined filter for room results (#7695)
Before this, global search returned also invites, which wasn't planned.
2026-09-11 17:36:38 +02:00
Benoit Marty 58b0f2ebc3 Merge pull request #7591 from element-hq/bma/iterateOnClientCreation
Iterate on client creation
2026-09-11 13:22:42 +02:00
Benoit Marty 3cde1523b4 Fix quality and tests. 2026-09-08 17:47:53 +02:00
Benoit Marty a817b6f219 Rename methods and update documentation. 2026-09-08 17:06:53 +02:00
Benoit Marty 59e72fc3ee Stop deleting the session data of a logged in account on the next login
sessionPaths keeps pointing at the directories of the account which has
just been logged in, and it was never reset. Adding another account
calls setHomeserver(), whose rotateSessionPath() starts by deleting the
directories of the previous sessionPaths, so the file and cache
directories of the first account were wiped.

finalizeClientCreation() now forgets the session paths once the login
succeeded. It is done there rather than in clear() on purpose: after a
failed attempt the directories are orphaned and must still be deleted by
the rotateSessionPath() of the next attempt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 16:47:58 +02:00
Benoit Marty 579ec9bd6a Close the client used to log in before creating the client of the session
Since the login flows stopped handing their client over to
RustMatrixClientFactory and let finalizeClientCreation() build a fresh
one from the SessionData, two problems appeared.

The client built by loginWithQrCode() was never owned by anyone: it is
not assigned to currentClient, so clear() had nothing to close and the
Rust Client stayed open for the whole app lifetime, holding the session
stores of the freshly logged in account. It is now tracked in
currentClient, and also disposed of when the QR login fails, which is
safe because that flow always builds its own client.

The client of the session was also built while the login client was
still open. Both use the same session paths, so their state and crypto
SQLite stores, and the search index when message search is enabled, were
opened twice at the same time with no cross process lock to protect
them. clear() now runs before the final client is created.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 16:47:58 +02:00
Benoit Marty 1f18a18917 Iterate on hooks implementation 2026-09-08 16:47:57 +02:00
Benoit Marty 5ce531fd44 Ensure we create a fresh Client when the sessionId is know after authentication. 2026-09-08 16:46:46 +02:00
renovate[bot] 3df1906d2a Update dependency org.matrix.rustcomponents:sdk-android to v26.09.08 (#7668)
* Update dependency org.matrix.rustcomponents:sdk-android to v26.09.08

* Fix API breaks:

- There's no `SyncServiceBuilder.withProfilesExtension()` method anymore. This is now enabled unconditionally in the SDK.
- Timeline filters no longer use the `org.matrix.rustcomponents.sdk.TimelineEventFilter` FFI wrapper, but the `uniffi.matrix_sdk_ui.TimelineEventFilter` type directly. This also changes the underlying types used for inclusion/exclusion.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-09-08 16:22:14 +02:00
Jorge Martin Espinosa f0a0700f5d Bump SDK bindings to v26.09.3 (#7637)
Fix API breaks:

- A new `Mentions` room list filter is available.
- `RoomListService.subscribeToRooms` is now `RoomListService.setRoomSubscriptions`.
- `enableAutomaticBackPagination` moved from `Client` to `ClientBuilder`.
2026-09-07 14:19:19 +02:00
Jorge Martin Espinosa dcd0bc782f Make sure enforce_element_pro is taken into account in FOSS (#7631)
* Make sure `enforce_element_pro` is taken into account in FOSS

* Make sure we crate `RustTemporaryMatrixClient` instances with a proper `serverName` value
2026-09-03 10:05:40 +02:00
Benoit Marty ab09500e7e Remove unused import 2026-08-31 15:06:39 +02:00
Benoit Marty 8081682f8f Remove ExternalSession, fallback login with Element Web is gone. 2026-08-31 12:07:20 +02:00
hayyaksi b85174d35e Only track read receipts on message-like events (#7361)
Ask the SDK to track receipts on message-like events only, for the live
timeline and for the focused and threaded ones, so all three agree. The
disabled case for the media and pinned-event timelines is unchanged. 

This matches the behaviour on Element X iOS.

The SDK attaches the receipt to the preceding event rather than the next
one, which is the placement its API offers.
2026-08-31 11:44:40 +02:00
Benoit Marty 8b03e4d41a Ensure that sessionVerifiedStatus is updated when the crypto is ready.
If we do not do that the FTUE state stays on WaitingForInitialState and user is stuck on a blank screen.
2026-08-31 09:14:03 +02:00
Benoit Marty 586ae00cda Ensure that noisy notifications are still noisy when content is hidden when a PIN code is protecting the application.
Closes #7575
2026-08-27 16:22:28 +02:00
Benoit Marty d9c39e8f98 Merge pull request #7480 from bxdxnn/fix/deleted-messages-thread
Fix removed messages hiding its thread on deletion
2026-08-27 10:04:36 +02:00
Benoit Marty 776cfc9c80 Add new type RoomRetention 2026-08-25 15:55:51 +02:00
Benoit Marty 16bc825c17 username has been renamed to serverNameFromUserId, but it is not necessary if we call homeserverUrl, so just remove it. 2026-08-25 15:55:29 +02:00
bxdxnn 3d400bad4a Merge 2026-08-24 20:04:47 +00:00
bxdxnn 65a827559b Merge 2026-08-24 10:30:25 +00:00
Benoit Marty e6116d5840 Move all binding containers to a di package and normalize their method names
Every @BindingContainer now lives in a di subpackage, in a file named after
it. Containers that were declared inside a shared file (SimplePlayer.kt,
LockScreenConfig.kt, VoiceMessagePresenter.kt, TimelineItemPresenterFactories.kt,
MediaItemPresenterFactories.kt) are extracted into their own file.

Method names are made consistent too:
- @Binds functions are named bind<ConcreteParameterType>, fixing three that
  named something else (notably RoomAliasResolverBindingContainer, whose
  provider was still called providesJoinRoomPresenterFactory).
- @Provides functions are named after what they provide, and all use the
  provides prefix rather than a mix of provide and provides.

ANDROID_KEYSTORE moves back to the cryptography impl package, next to
KeyStoreSecretKeyRepository which uses it; it is not DI specific and would
otherwise be unreachable from there.

No behaviour change: Metro discovers containers via @ContributesTo and does
not care about method names, so the only call site to follow was in
DefaultVoiceRecorderTest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 11:38:11 +02:00
Benoit Marty 1018d26211 Rename all @BindingContainer types with a BindingContainer suffix
Metro's @BindingContainer replaced Dagger's @Module, but the declarations
kept the old Module suffix. Rename them (and their dedicated files) so the
type name matches the annotation, matching UserStatusBindingContainer which
already followed this convention.

No behaviour change: Metro discovers containers via @ContributesTo, so there
were only two call sites to update, both in tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 10:08:54 +02:00
Benoit Marty 16954bb66e Merge pull request #7449 from hayaksi1/fix/4112-wildcard-mime-type
Send a concrete mime type for media shared with a wildcard one
2026-08-24 09:41:18 +02:00
Benoit Marty 679c6e4786 Merge pull request #7410 from element-hq/feat/global-search-screen
Feature: global search
2026-08-24 09:34:35 +02:00
Benoit Marty a33a84a684 Merge pull request #7500 from element-hq/feature/account-provider-full-mxid
Let users enter their full Matrix user ID on the account provider screen
2026-08-24 08:24:50 +02:00
Benoit Marty 45d9339bfa Merge pull request #7495 from element-hq/refactor/add-client-enterprise-hooks
Add `ClientEnterpriseHook` and `ClientBuilderEnterpriseHook`
2026-08-22 08:10:50 +02:00
Benoit Marty 277dd4a2fd Fix test compilation 2026-08-21 18:53:43 +02:00
Benoit Marty e271a6b4a8 Revert change on dependencies 2026-08-21 18:13:44 +02:00
Jenna Vassar 2182840a71 Let users enter their full Matrix user ID on the account provider screen 2026-08-21 08:53:23 -07:00
Jorge Martín c56bb66307 Fix ClientBuilderEnterpriseHook not returning an updated ClientBuilder 2026-08-21 17:32:45 +02:00
Benoit Marty eeaf0166f5 Merge pull request #7443 from hayaksi1/fix/4519-hide-verification-fallback
Do not render in-chat key verification requests in the timeline
2026-08-21 16:52:58 +02:00
Jorge Martín 4b32816b32 Add ClientEnterpriseHook and ClientBuilderEnterpriseHook
These allow us to not expose the enterprise internal when setting up custom configs for both `ClientBuilder` and `Client`
2026-08-21 10:05:00 +02:00
Jorge Martín 9d36c8c4ed Export missing MessageSearchService to SessionScope 2026-08-20 13:53:49 +02:00
hayaksi1 c239190994 Merge develop into the wildcard mime type branch
Develop gained resolveImageMimeType, which reads the image header so a
share that declares a broad type is encoded as the format it really is.
Resolving the wildcard first would hand that helper a concrete image/jpeg
and make it return early, so a transparent PNG shared as image/* would be
flattened and an animated GIF would be recompressed. The header is now
read from the type the sender declared and the default subtype is applied
to whatever comes back, so the sniffing still runs and an undecodable file
no longer keeps a wildcard.

A non-image shared as image/* is therefore sent as image/jpeg rather than
image/*, which is the whole point of this branch, so the test covering
that case now expects the default subtype.
2026-08-20 14:26:57 +03:00
hayyaksi 918015b8bb Stop waiting for a room alias that the remote server never resolves (#7446)
Tapping a room alias whose server is down left the resolver screen on a
spinner for as long as the screen stayed open, with no way forward other
than going back.

Bound the resolution with the ten second timeout already used when
joining a room by address, so the retry dialog is shown instead. The fake
client's resolve lambda becomes suspending so a server that never answers
can be simulated.
2026-08-20 09:34:15 +02:00
bxdxnn 2ff6a56e7d Use the new SDK thread info for redacted messages 2026-08-19 16:12:15 +00:00
ganfra cf2ce2bd65 Use Profiles sliding sync extension check for own profile subscription (#7403)
* Use Profiles sliding sync extension check for own profile subscription

---------

Co-authored-by: Jorge Martin Espinosa <jorgem@element.io>
2026-08-19 13:00:27 +02:00
Jorge Martin Espinosa a1e86ad499 Use the right base URL for the ESS config/well known endpoints (#7469)
* Rename `UrlContentFetcher` to `ClientUrlContentFetcher` and add missing base URL data (server name, homeserver URL)

* Avoid passing the `homeserverUrl/serverName` around.

Calculate the URL in `DefaultRemoteEnterpriseConfigRetriever` using the newly added `homserver` and `server` values as the possible base URLs, depending on the remote config source

* Make sure we don't perform blocking requests to fetch the remote config when restoring a session

Add a `needsRefresh` parameter to `RemoteEnterpriseConfigResult.NotFound` to handle this, and store a `no-config` value in the store to indicate an endpoint has been checked and no config was found

* Bump enterprise module
2026-08-19 09:24:22 +02:00
Jorge Martin Espinosa c31d7e6cce Don't restart the sync service if the client is shutting down (#7472)
* Don't restart the sync service if the client is shutting down

This was causing issues when clearing the cache:

1. The client would ask the SDK to clear the caches.
2. The SDK would stop the sync service, clear the caches and set the `pos` value of sliding sync to 0 so the HS returns all the required state the next time the client is used.
3. However, between the sync service being stopped with the `pos=0` change and the client being destroyed, there was enough time for the `SyncOrchestrator` to decide the sync service was stopped for no good reason since there is network connectivity and the app is on foreground, so it restarted the sync, with `pos=0`.
4. This value was persisted, and the next time the new client did an 'initial sync' it had a `pos != 0`, which the HS uses to avoid returning some required state it already fetched.
5. The room list now lacks state events for lots of rooms and room names, avatars, members, etc. are now missing.

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
2026-08-18 16:50:57 +00:00
Benoit Marty 378fbfa1d8 Merge pull request #7441 from hayaksi1/fix/5978-caption-markdown
Convert markdown to HTML when a caption is edited
2026-08-18 10:05:19 +02:00
Benoit Marty 25094cbd06 Merge pull request #7445 from hayaksi1/fix/2617-user-id-with-slash
Open the user profile of a user id that contains a slash
2026-08-18 10:04:27 +02:00
renovate[bot] e6e93c9bd0 Update dependency org.matrix.rustcomponents:sdk-android to v26.08.17 (#7460)
* Update dependency org.matrix.rustcomponents:sdk-android to v26.08.17

* Fix API breaks:

- `ClientBuildException.WellKnownLookupDisabled` should be handled now.
- `Client.sendReply` returns a `Result<SendHandle>` now. We can ignore it like we do for `Client.send`.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-08-17 21:06:28 +02:00
hayaksi1 98ef737b1d Rename withDefaultSubtype to ensureDefaultSubtype
The old name read as though the default subtype always replaced whatever the
receiver carried, when a mime type that already has a concrete subtype is
returned untouched.
2026-08-17 15:52:46 +03:00