Commit graph

94 commits

Author SHA1 Message Date
Benoit Marty
8c5caabed4 Sign in with Classic 2026-04-13 11:16:05 +02:00
Jorge Martin Espinosa
3a7faa8b76
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
e821f75a88
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
313aa7e3c2 change(space) : last admin navigate to security&privacy 2025-12-15 20:46:23 +01:00
renovate[bot]
539aa35eeb
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
0beeda6001 misc: AsyncData map non nullable 2025-11-21 18:41:49 +01:00
Benoit Marty
eb31505dc7 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty
f86431e663 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty
c4e0370f41 Copyright: run command uv run license-editor --repository ../element-x-android 2025-11-10 10:09:26 +01:00
Benoit Marty
07b6148035 Remove context(parentNode: Node) and provide the parent Node as a parameter. 2025-10-31 12:04:57 +01:00
Benoit Marty
f174084942 Use context parameter for the parentNode 2025-10-30 16:32:53 +01:00
Benoit Marty
be03c50aaf 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
ea616be814 Fix "Backing property is only allowed when a matching property or function exists" 2025-10-30 13:27:19 +01:00
Benoit Marty
26ce78d27d
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
1e546335df
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
4b65d5cf9a Remove dead code. 2025-09-16 14:38:32 +02:00
Benoit Marty
a1aeb24f23 Add test on DefaultEntryPoints 2025-09-16 14:38:32 +02:00
Benoit Marty
a575019760 Use DependencyHandlerScope.testCommonDependencies() 2025-09-16 14:38:31 +02:00
Benoit Marty
a69cf58a5b Add test on DefaultSpaceEntryPoint 2025-09-16 14:38:31 +02:00
Benoit Marty
8d533e8a20 Other cleanup 2025-09-05 16:54:45 +02:00
Jorge Martín
08bbe3fdaa 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
4ab62a6a38 Redo DI gradle setup code 2025-09-04 16:49:20 +02:00
Jorge Martín
29a97fc0d9 Fix lint issues and restore commented out code 2025-09-04 16:49:18 +02:00
Jorge Martín
b76a71ebf5 Start migrating Anvil KSP to Metro 2025-09-04 16:48:34 +02:00
João Breno
150d0790bc
Update state in runUpdatingState when CancellationException occurs (#5243) 2025-09-01 15:07:32 +02:00
Benoit Marty
476a2b9007 Avoid using runBlocking in Node resolve function. 2025-08-14 16:53:35 +02:00
Jorge Martin Espinosa
1a335698c0
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
efdc10e60a
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
97f3be3dc5 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
fb52657b12 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
f61df38e55 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Benoit Marty
1f8b525548 Fix back navigation issue, when opening directly the notification troubleshoot screen. 2024-06-17 16:53:21 +02:00
Benoit Marty
4dff3e9cce Ensure that the Loading Dialog and the toggles update at the same time. 2024-06-12 12:50:55 +02:00
Benoit Marty
9a24e7d4af Change type of NotificationSettingsState.currentPushDistributor from AsyncAction to AsyncData 2024-05-28 14:18:00 +02:00
Benoit Marty
7f9a30a033 Improve code and display error. 2024-05-21 14:45:16 +02:00
Benoit Marty
f807d578fa Period 2024-05-01 19:35:16 +02:00
Benoit Marty
83506e5191 Fix navigation issue #2778 2024-05-01 13:50:53 +02:00
Jorge Martin Espinosa
134cacb024
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
92d8e4f55b
Merge branch 'develop' into feature/bma/sxcludePreviewFromCodeCoverage 2024-01-11 16:02:58 +01:00
Benoit Marty
a831f05f6e Fix ktlint issues 2024-01-10 19:33:39 +01:00
Benoit Marty
bac1e3902c Ignore ktlint issue for this particular val. 2024-01-10 19:31:36 +01:00
renovate[bot]
c8bd362397
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
371065bfdd Exclude ContentToPreview from coverage, either by using annotation @ExcludeFromCoverage, or by inlining it. 2024-01-09 17:56:01 +01:00
Benoit Marty
7b2341aec7 Rename Async to AsyncData 2024-01-04 16:30:56 +01:00
Benoit Marty
d953c979e1 Introduce AsyncAction with a Confirmation state and use it for logout action. 2024-01-04 15:56:16 +01:00
ganfra
c4dc024c63 Fix detekt 2023-12-19 12:59:13 +01:00
ganfra
78bd6915c7 BackstackParentNode now become BaseFlowNode and adds Overlay navModel into it. 2023-12-19 12:55:14 +01:00
ganfra
b11f98afe8 Add Overlay navModel and related classes 2023-12-19 12:54:09 +01:00
Marco Romano
f186a85ed0
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
a6e4644cfa
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