1
0
mirror of https://github.com/element-hq/element-x-android.git synced 2026-10-23 18:49:00 +03:00

105 Commits

Author SHA1 Message Date
Benoit Marty
4c4cdd1678 Merge branch 'develop' into fix/6371-save-file-name-conflicts 2026-08-24 09:38:35 +02:00
Benoit Marty
a6a09a8be0 Move FakeParentNode to the testutils module
The fake was declared in RootFlowNodeTest, so other tests could not use
it. Move it to the testutils module, in the node package, and make its
documentation generic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 16:01:31 +02:00
Benoit Marty
8e4b2145d5 Move FakeNodeFactoriesBindings to the testutils module
The fake was declared in RootFlowNodeTest, so other tests could not use
it. Move it to the testutils module, in a new node package.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 15:56:39 +02:00
Benoit Marty
e85c5041a4 Move NotUsedPresenter to the testutils module
The fake presenter was declared in RootFlowNodeTest, so other tests could
not use it. Move it to the testutils module, in a new presenter package,
along with MutablePresenter.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 15:51:30 +02:00
hayaksi1
59b26173a7 Create the fake MediaStore directory without java.nio.file
Files.createTempDirectory needs API 26 and the fake lives in the main source
set of tests:testutils, so lint failed it against the minimum of 24.
File.createTempFile has been available since API 1 and still gives each
provider instance its own directory.
2026-08-13 17:36:51 +03:00
hayaksi1
4558590492 Cover both MediaStore save paths with a fake provider
DefaultFileSave had no test at all and AndroidLocalMediaActions only exercised the
failing path, so neither the uniquifying retry nor the new IOException on a null
insert was ever executed.

FakeMediaStoreContentProvider stands in for the media authority: it records the
display names an insert is attempted with, keeps whatever is copied into it, and can
either collide a name the way MediaStore does past 32 files or refuse to create
anything. Both call sites now go through it for the plain save, the retry and the
rejected insert.

Its name cannot follow the Fake<Interface> convention because it extends the
framework ContentProvider, so it joins the existing exceptions in
KonsistClassNameTest next to FakeFileSystem and FakeKeyStore.
2026-08-10 11:49:15 +03:00
Benoit Marty
9c66cd331f [Link new device] Handle split steps in the SDK 2026-08-06 17:22:10 +02:00
Benoit Marty
95e656cc32 Fix regression on tests. 2026-06-29 09:11:51 +02:00
Benoit Marty
c430877d87 Ensure Robolectric test are run using API 36 until the library support API 37. 2026-06-18 12:18:32 +02:00
Timo
c959f50d53 Back button web view to esc (revive fixed version of: https://github.com/element-hq/element-x-android/pull/6724) (#6725)
* Change native back button behavior in EC view:
 - inject escape into webview instead of going back.
 - the webview will call back when no other modal is open.

* call down and up in the webview + make sure that we fall back to close
pip in case the webview did not handle the esc action.

* Tests and refactor to CallScreenBackPressPolicy

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
2026-05-13 10:17:23 +02:00
Benoit Marty
11b9efa2c9 Migrate to v2 testing APIs 2026-04-30 16:04:07 +02:00
Benoit Marty
8eb5a55673 Introduce simplePluralStringResource methods, as Composable and in StringProvider. 2026-04-21 11:22:43 +02:00
ganfra
fbfeeae084 Fix formatting 2026-04-16 16:18:53 +02:00
ganfra
704ddc9132 Update live location shares when reaching timeout (before actual stop event) 2026-04-16 15:33:42 +02:00
Benoit Marty
233d22367f Cleanup 2026-01-02 16:07:45 +01:00
Benoit Marty
4aadbed0b1 Fix test issue: "java.security.KeyStoreException: AndroidKeyStore not found" 2025-12-19 09:27:11 +01:00
Benoit Marty
54e742075d Detekt: enable rule exceptions.SwallowedException and fix existing issue. 2025-12-05 09:45:23 +01:00
Benoit Marty
d4ff8dcf82 Improve test. 2025-12-03 18:05:10 +01:00
Benoit Marty
c97e60fcaf Remove confirmExitAction and use AsyncAction.ConfirmingCancellation instead. 2025-12-03 18:05:09 +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
cbbd0ff079 Fix typo 2025-11-10 09:37:01 +01:00
Benoit Marty
b871725423 Improve error displayed when the Unconsumed Event cannot be displayed. 2025-11-07 12:51:35 +01:00
Benoit Marty
6ef9964de9 Cleanup and remove warning, this code is not reachable by production code. 2025-10-24 09:44:30 +02:00
Benoit Marty
bebde0e9dd Cleanup 2025-09-16 14:38:32 +02:00
Benoit Marty
a69cf58a5b Add test on DefaultSpaceEntryPoint 2025-09-16 14:38:31 +02:00
Benoit Marty
0b5cb57e46 Extract plantTestTimber 2025-09-11 16:58:47 +02:00
ganfra
09e5734251 feature (room upgrade) : add tests 2025-06-11 16:16:41 +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
renovate[bot]
7bb1e24ff5 fix(deps): update dependency androidx.compose:compose-bom to v2025.04.01 (#4631)
* fix(deps): update dependency androidx.compose:compose-bom to v2025.04.01

* Fix autofill deprecations

* Adapt our custom BottomSheetState and scaffold to the new APIs

* Get rid of all the custom bottom sheet implementation

It doesn't seem to be needed anymore 🎉

* Replace `semantics { invisibleToUser() }`  with `hideFromAccessibility()`

* Update screenshots

* Add commit and cancel callbacks for autofill on the login view

* Fix broken tests caused mainly by https://issuetracker.google.com/issues/366255137

Add `LocalUiTestMode` composition local and helper functions.

* Remove dependency that caused a new license to need to be approved

* Let setSafeContent handle setting the value for LocalUiTestMode

* Fix broken test

* Apply fix to RoomMemberModerationViewTest and RoomListDeclineInviteMenuTest

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-06-03 21:05:43 +00:00
Benoit Marty
4572419ed2 Stronger lambda error (#4771)
* Make sure lambdaError() make the test fail in all circumstances.

* Fix existing errors on tests.

* Uniformize the way we are creating class under test.

* Cleanup

* Fix typo

* Fix failing test after rebase.
2025-05-27 15:32:09 +00:00
Jorge Martin Espinosa
f455085e08 Notification events resolving and rendering in batches (#4722)
- Use `NotiticationService.getNotifications()` function so we resolve the events in bulk.
- Added `NotifierResolverQueue` to group the notifications to resolve based on a debounce strategy.
- Batch rendering of these events as notifications.
2025-05-26 17:10:20 +02:00
Jorge Martin Espinosa
fd50ce4daf Add user verification and verification state violation badges (#4392)
* Move `observeRoomMemberIdentityStateChange` and associated classes to `libs:matrixui` module so they can be reused

* Add `EncryptionService.getUserIdentity` method to retrieve not only if the user is verified or not, but in which state they are

* Fix `IdentityChangePresenter` after the previous changes

* Fix `withFakeLifecycleOwner` and add `testWithLifecycleOwner` helper

* Display verified badge in DM top app bar when possible

* Display a verification violation warning icon next to the 'People' item in room details screen

* Display either a verified badge or a verification violation warning icon next to the room members in the room member list screen

* Display either a verified badge or a verification violation warning and withdraw verification button in the room member profile.

Generic user profiles won't display verification state anymore since we can't easily track changes in it.

* Add preview for room member details screen with verification violation identity state

* Add verified and violation badge to the `Profile` list item in room details screen

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-12 12:22:53 +01:00
Jorge Martin Espinosa
f73c0e42a4 Implement user verification (#4294)
* Add support for starting verification of a user

* Add support for replying to incoming user verification requests

* Add reset recovery key button and previews to `ChooseSelfVerificationModeView`

* Add 'Profile' item in room details screen

* Update screenshots

* Remove `showDeviceVerifiedScreen` parameter from `NavTarget.UseAnotherDevice`

* Allow exiting the FTUE flow, which will close the app. The previous state will be restored when the app is reopened.

* When outgoing verification fails, move to the `Canceled` state. Then, when resetting the state machine state also reset the verification service.

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-10 11:20:17 +01:00
Benoit Marty
2e9a158fb0 Update Matrix Room API and allow media swipe on pinned event only. 2025-02-17 16:45:25 +01:00
Benoit Marty
8f281ffa3c Extract testEnv to the test module 2025-02-05 15:20:18 +01:00
Benoit Marty
7878f97453 Update incoming call notification content to "📹 Incoming call" 2025-02-04 16:20:53 +01: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
da272ddb07 Implement month separator for the Gallery.
Improve day separator rendering in the timeline.
Use Today, Yesterday, and the name of the day if less than 7 days and do not render the year for the current year.
Improve date format for the media viewer.
Rework how date and time are computed.
ActionListView: Time can take more space, so update the layout.
2024-12-11 23:57:57 +01:00
Benoit Marty
8dfe5300b8 Rename parameter. 2024-11-08 10:11:06 +01:00
Benoit Marty
585b6a94f3 Delete temporary created files. 2024-11-08 10:11:06 +01:00
Benoit Marty
25e3aa6fc4 Remove runBlocking usage in LambdaRecorder. 2024-10-16 10:03:18 +02:00
Jorge Martin Espinosa
366db4791b Upgrade Kotlin to v2.0 (#3594)
* Bump Kotlin to v2.0

* Fix lots of issues due to the upgrade: lint issues, function signature incompatibilities, broken tests, etc.

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-10-10 08:32:00 +00:00
Benoit Marty
29356b96c1 Merge pull request #3554 from element-hq/feature/bma/testEmptyTimeline
Add unit tests on TimelineItemsSubscriber
2024-10-02 14:04:48 +02:00
Jorge Martin Espinosa
79c17f714f Use Anvil KSP instead of the Square KAPT one (#3564)
* Use Anvil KSP instead of the Square KAPT one

* Fix several configuration cache, lint and test issues

* Allow incremental kotlin compilation in the CI

* Workaround Robolectric + Compose issue that caused `AppNotIdleException`

* Update the `enterprise` commit hash

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2024-10-02 11:52:17 +00:00
Benoit Marty
f89463c3a1 Remove runCancellableScopeTest and runCancellableScopeTestWithTestScope, we can use TestScope.backgroundScope instead. 2024-09-27 18:37:16 +02:00
renovate[bot]
9756afc5d1 Update dependency androidx.compose:compose-bom to v2024.09.00 (#3399)
* Update dependency androidx.compose:compose-bom to v2024.09.00

* Adapt code for changes.

* Workaround crash when closing the RTE

* Fix broken bottom sheet colors and shape

* Fix tons of warnings and deprecations

* Fix lint issues

* Fix more M3 update changes

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: ganfra <francoisg@matrix.org>
Co-authored-by: ElementBot <android@element.io>
2024-09-26 09:30:20 +02:00
Benoit Marty
d1be4349f0 Add test on RustRoomDirectoryList 2024-09-19 15:40:25 +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