93 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
78c9076281 Fix TransactionTooLargeExceptions caused by Appyx (#6410)
* Fix `TransactionTooLargeExceptions` caused by Appyx

After a long debugging session, we discovered the code Appyx uses to clear the saved state of nodes that have been removed is not working because of a race condition, causing this saved state to grow indefinitely.

To fix it, we need to wait until the node has been disposed, which will call `SaveableStateHolder.removeState` once, removing the associated `SaveableStateRegistry`, and *then* call `removeState` again when we detect the node has been removed from the navigation graph.

Since these classes and APIs are private in Appyx, we had to copy and modify and use these copies.

* Remove ktlint checks on `SafeChildrenTransitionScope.kt`

* Don't count the new code for coverage
2026-03-23 18:07:00 +01:00
Jorge Martin Espinosa
2d3e59912a Add code to help debugging the saved nav state graph (#6295)
* Add code to help debugging the saved nav state graph: this would help us diagnose the `TransactionTooLargeException` reports we've been seeing for months.
2026-03-06 14:44:30 +00:00
ganfra
a21b66b862 change(space) : last admin navigate to security&privacy 2025-12-15 20:46:23 +01:00
renovate[bot]
84d368741a fix(deps): update android.gradle.plugin to v8.13.1 (#5260)
* fix(deps): update android.gradle.plugin to v8.13.1

* Remove warning about AGP 8.12.x+

* Fix proguard-related code deprecations, use the new `optimization` API

* Workaround issues related to Android lint not being able to check these complex methods with kotlin contracts

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-11-26 11:57:22 +01:00
ganfra
b243394b67 misc: AsyncData map non nullable 2025-11-21 18:41:49 +01:00
Benoit Marty
1292da2a72 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty
b748fcc631 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty
0a0224b586 Copyright: run command uv run license-editor --repository ../element-x-android 2025-11-10 10:09:26 +01:00
Benoit Marty
e70d767183 Remove context(parentNode: Node) and provide the parent Node as a parameter. 2025-10-31 12:04:57 +01:00
Benoit Marty
05c5f3c914 Use context parameter for the parentNode 2025-10-30 16:32:53 +01:00
Benoit Marty
5197154f54 Ensure a Callback and only one is provided in the Plugin. Also reduce boilerplate code in Nodes. 2025-10-30 16:32:51 +01:00
Benoit Marty
e22ecb68c3 Fix "Backing property is only allowed when a matching property or function exists" 2025-10-30 13:27:19 +01:00
Benoit Marty
08f75dda4c Confirm exit without saving change in room details edit screen (#5618)
* Room details edit screen: add confirmation dialog when leaving without saving pending changes.

* Improve preview coverage.

* Update screenshots

* Introduce AsyncAction.ConfirmingCancellation and use it for leaving room edition without saving change.

* Fix issue in comment

* Use new `ConfirmingCancellation` object in Change Roles screen

---------

Co-authored-by: ElementBot <android@element.io>
2025-10-28 18:25:51 +01:00
Benoit Marty
73a6ba2849 Multi accounts - experimental first implementation (#5285)
* Multi account - Do not reset analytics store on sign out.

Else when 1 of many accounts is removed, the analytics opt in screen is displayed again.

* Multi accounts - first implementation.

* Multi accounts - Prevent user from logging twice with the same account

* Multi accounts - ignore automatic GoBack in case of error.

* Multi accounts - update first view when adding an account.

* Rename method storeData to addSession.

* Multi accounts - handle account switch when coming from a notification

* Multi accounts - handle login link when there is already an account.

* Multi accounts - handle click on push history for not current account.

* Multi accounts - improve layout and add preview.

* Add accountselect modules

* Multi accounts - incoming share with account selection

* Multi accounts - check the feature flag before allowing login using login link.

* Multi accounts - swipe on account icon

* Cleanup

* Multi accounts - fix other implementation of SessionStore

* Multi accounts - fix PreferencesRootPresenterTest

* Multi accounts - Add test on AccountSelectPresenter

* Multi accounts - Fix test on HomePresenter - WIP

* Update database to be able to sort accounts by creation date.

* Add unit test on takeCurrentUserWithNeighbors

* Fix test and improve code.

* Add exception

* Multi accounts - handle permalink

* Code quality

* Multi accounts - localization

* Fix issue after rebase on develop

* Fix issue after rebase on develop

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Update Multi accounts flag details.

* Add missing test on DatabaseSessionStore

* Add missing preview on LoginModeView

* Remove dead code.

* Add missing preview on PushHistoryView

* Document API.

* Rename API and update test.

* Remove MatrixAuthenticationService.loggedInStateFlow()

* Update screenshots

* Remove unused import

* Add exception

* Fix compilation issue after rebase on develop.

* Update screenshots

* Fix test

* Avoid calling getLatestSession() twice

* Rename `matrixUserAndNeighbors` to `currentUserAndNeighbors`

* Extract code to its own class.

* Add comment to clarify the code.

* Init current user profile with what we now have in the database.

It allows having the cached data (user display name and avatar) when starting the application when no network is available.

* Let the RustMatrixClient update the profile in the session database

* Fix test.

* When logging out from Pin code screen, logout from all the sessions.

tom

* Make PushData.clientSecret mandatory.
Also do not restore the last session as a fallback, it can lead to error in a multi account context, or even when a ghost pusher send a Push.

* Change test in RustMatrixAuthenticationServiceTest

* Do not use MatrixAuthenticationService in RootFlowNode, only use SessionStore

* Remove MatrixAuthenticationService.getLatestSessionId()

* Fix compilation issue after merging develop

* Add test on DefaultAccountSelectEntryPoint

* Fix compilation issue after merging develop

* Introduce LoggedInAccountSwitcherNode, to improve animation when switching between accounts.

* Rename Node to follow naming convention.

* Fix navigation issue after login.

* Remove unused import

* Revert "Fix navigation issue after login."

This reverts commit e409630856d7a7e741548016d7afe174ff1b40f7.

* Revert "Rename Node to follow naming convention."

This reverts commit 883b1f37c7207512d9f6605749977ad9045846a1.

* Revert "Introduce LoggedInAccountSwitcherNode, to improve animation when switching between accounts."

This reverts commit 9c698ff8152aceb5fd2b8b5ab5f609d28de64d24.

* Metro now have `@AssistedInject`.

* Update screenshots

* Introduce DelegateTransitionHandler and use it in RootFlowNode

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: ganfra <francoisg@element.io>
2025-09-26 15:45:06 +02:00
Benoit Marty
514db70656 Remove dead code. 2025-09-16 14:38:32 +02:00
Benoit Marty
e36273b94c Add test on DefaultEntryPoints 2025-09-16 14:38:32 +02:00
Benoit Marty
629fc552e5 Use DependencyHandlerScope.testCommonDependencies() 2025-09-16 14:38:31 +02:00
Benoit Marty
1516bb7db4 Add test on DefaultSpaceEntryPoint 2025-09-16 14:38:31 +02:00
Benoit Marty
aee66d6316 Other cleanup 2025-09-05 16:54:45 +02:00
Jorge Martín
2907cef47e Some cleanup:
- Remove unnecessary `GlobalScope`.
- Rename `Component` to `Graph`, `DaggerComponentOwner` to `DependencyInjectionGraphOwner`.
- Rename component builders to factories, where necessary.
2025-09-04 16:49:21 +02:00
Jorge Martín
e06bacbff3 Redo DI gradle setup code 2025-09-04 16:49:20 +02:00
Jorge Martín
fc3153bd26 Fix lint issues and restore commented out code 2025-09-04 16:49:18 +02:00
Jorge Martín
92a4b8b66b Start migrating Anvil KSP to Metro 2025-09-04 16:48:34 +02:00
João Breno
fbca1b3dfe Update state in runUpdatingState when CancellationException occurs (#5243) 2025-09-01 15:07:32 +02:00
Benoit Marty
16acfa28d7 Avoid using runBlocking in Node resolve function. 2025-08-14 16:53:35 +02:00
Jorge Martin Espinosa
955263bee1 Force last owner of a room to pass ownership when leaving (#5094)
* Move `ChangeRoles*` classes to their own module so they can be shared

* Hook the change roles screen to the leave room action, add confirmation dialogs

* Use enum instead of sealed interface for `ChangeRoomMemberRolesListType`

* Try to improve communications between nodes

* refactor (leave room) : makes sure to expose only necessary code from api module

* Add `:libraries:previewutils` module to share some test fixtures used for UI previews

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: ganfra <francoisg@matrix.org>
2025-08-05 17:24:14 +02:00
Jorge Martin Espinosa
58a3ea8b1f Add catchingExceptions method to replace runCatching (#4797)
- Add `runCatchingExceptions` and `mapCatchingExceptions` to replace `runCatching` and `mapCatching`.
- Make `tryOrNull { ... }` catch only exceptions too.
- Apply the changes to the whole project.
- Add new Rust fakes for tests to handle the code that's now unblocked - previously it just threw an `UnsatisfiedLinkError` which we ignored.
- Add a new `detekt-rules` project with a `RunCatchingRule` to prevent `runCatching` and `mapCatching` usages.
2025-06-04 09:02:26 +02:00
Benoit Marty
05fc76822a Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-07 10:05:04 +01:00
Benoit Marty
97fb7bc2fa Let AsyncAction.Confirming be an interface, with a AsyncAction.ConfirmingNoParams data object.
This will allow inheritance of `AsyncAction.Confirming` with parameter(s).
2024-10-14 10:49:55 +02:00
Benoit Marty
2b016227e9 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Benoit Marty
059c0dfe59 Fix back navigation issue, when opening directly the notification troubleshoot screen. 2024-06-17 16:53:21 +02:00
Benoit Marty
f24036d688 Ensure that the Loading Dialog and the toggles update at the same time. 2024-06-12 12:50:55 +02:00
Benoit Marty
306b779ca5 Change type of NotificationSettingsState.currentPushDistributor from AsyncAction to AsyncData 2024-05-28 14:18:00 +02:00
Benoit Marty
e64051f7bd Improve code and display error. 2024-05-21 14:45:16 +02:00
Benoit Marty
08765691d2 Period 2024-05-01 19:35:16 +02:00
Benoit Marty
981c19ab33 Fix navigation issue #2778 2024-05-01 13:50:53 +02:00
Jorge Martin Espinosa
d8f9408cdb Room member moderation: kick, ban and unban (#2496)
* Room member moderation: kick, ban and unban

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-03-06 16:44:05 +01:00
Benoit Marty
a926b3d390 Merge branch 'develop' into feature/bma/sxcludePreviewFromCodeCoverage 2024-01-11 16:02:58 +01:00
Benoit Marty
d3830af78b Fix ktlint issues 2024-01-10 19:33:39 +01:00
Benoit Marty
3084d71c39 Ignore ktlint issue for this particular val. 2024-01-10 19:31:36 +01:00
renovate[bot]
7e9cda3aa9 Update plugin ktlint to v12.1.0 (#2200)
* Update plugin ktlint to v12.1.0

* Run `./gradlew ktlintFormat` and fix some issues manually.

* Fix other issues reproted by Ktlint

* Limit false positives, KtLint removes unnecessary curly brace in String templates.

* Remove useless Unit

* Minor improvements over ktlint changes

* Restore `AlertDialogContent` behaviour

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-01-10 16:22:24 +01:00
Benoit Marty
7fbe848243 Exclude ContentToPreview from coverage, either by using annotation @ExcludeFromCoverage, or by inlining it. 2024-01-09 17:56:01 +01:00
Benoit Marty
bd91dd64e2 Rename Async to AsyncData 2024-01-04 16:30:56 +01:00
Benoit Marty
da23628c8a Introduce AsyncAction with a Confirmation state and use it for logout action. 2024-01-04 15:56:16 +01:00
ganfra
9f045fc7de Fix detekt 2023-12-19 12:59:13 +01:00
ganfra
280d55bd6e BackstackParentNode now become BaseFlowNode and adds Overlay navModel into it. 2023-12-19 12:55:14 +01:00
ganfra
b6ef4cdab2 Add Overlay navModel and related classes 2023-12-19 12:54:09 +01:00
Marco Romano
c69d610b6c Rename params in NodeFactories for clarity (#1916)
- `context` is now `buildContext` to reflect that it's of type `BuildContext` (and not an android `Context`).
- `NODE` generic type param is now `N` to stick with Java convention: https://docs.oracle.com/javase/tutorial/java/generics/types.html.
2023-11-29 10:01:07 +01:00
Marco Romano
e59a6b7ed6 Add missing screenshots in TimelineView (#1660)
Add audio, voice  and poll screenshots to TimelineView which were missing.
2023-10-27 12:18:28 +00:00
Jorge Martin Espinosa
5e547269e7 Integrate Element Call with widget API (#1581)
* Integrate Element Call with widget API.

- Add `appconfig` module and extract constants that can be overridden in forks there.
- Add an Element Call feature flag, disabled by default.
- Refactor the whole `ElementCallActivity`, move most logic out of it.
- Integrate with the Rust Widget Driver API (note the Rust SDK version used in this PR lacks some needed changes to make the calls actually work).
- Handle calls differently based on `CallType`.
- Add UI to create/join a call.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-19 15:38:43 +00:00