Commit Graph

135 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
49e1cfed42 Fix verification failed issue, simplify verification logic (#3830)
* Simplify session verification:

- Reuse Rust `Client` instances created on the login process so we don't need to restore one right before the session verification.
- Remove unnecessary sources of verification state updates.
- Add an intermediate FTUE flow step which will display an indeterminate progress indicator instead of a blank screen.

* Remove unnecessary workaround: the SDK should already handle this

* Add regression tests for noop analytics service usage.

* Add `services.analytics.noop` module to the test dependencies

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-11-08 16:42:27 +01:00
Jorge Martin Espinosa
f8cdd0a712 Fix the onboarding flow getting stuck in some cases (#3778)
This was caused by several `DefaultFtueService` instances being created and only the latest one receiving new state updates while the `LoggedInFlowNode` which decides the navigation was stuck subscribed to the initial one. `DefaultFtueService` has now been marked as s singleton to fix this.
2024-10-31 10:55:17 +00:00
Benoit Marty
d1b3ecab36 Incoming session verification request
Add more log to the state machines
Ensure the block cannot be cancelled, else if the Rust SDK emit a new state during the API execution, the state machine may cancel the api call.
Let VerificationFlowState values match the SDK api for code clarity.
Rename sub interface for clarity.
Migrate tests to the new FakeVerificationService.
2024-10-29 09:26:15 +01:00
bmarty
f19ea02390 Sync Strings from Localazy 2024-10-21 00:27:20 +00:00
Benoit Marty
08673f44ce Use backgroundScope 2024-10-07 17:46:19 +02:00
bmarty
05291bcf2f Sync Strings from Localazy 2024-10-07 00:28:33 +00:00
renovate[bot]
d67fae8d4c fix(deps): update dependency io.nlopez.compose.rules:detekt to v0.4.15 (#3595)
* Update dependency io.nlopez.compose.rules:detekt to v0.4.15

* Fix new detekt issues

* Fix KtLint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2024-10-04 16:58:19 +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
ec4f2dcfbf Properly skip the FTUE verification screen if verification is not needed. 2024-09-04 16:41:34 +02:00
SpiritCroc
02dbaab3d5 Fix login navigation getting stuck with no-op analytics provider
Change-Id: Icac04e1193e12943c2b8598f48d79ac6e7cef3a5
2024-08-24 22:22:10 +02:00
bmarty
5765d9bf9f Sync Strings from Localazy 2024-08-19 00:25:36 +00:00
Jorge Martín
e16057a366 Initial implementation of the reset identity feature 2024-08-13 08:55:05 +02:00
bmarty
d288ace4bd Sync Strings from Localazy 2024-07-29 00:26:27 +00:00
ElementBot
9522569860 Sync Strings (#3232)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2024-07-22 08:59:47 +00:00
Benoit Marty
18e6304e0a Fix test compilation 2024-07-08 17:49:39 +02:00
Benoit Marty
a83c5d4bd7 When clearing cache, ensure that SessionPreferencesStore is removed from the cache.
Fixes blank screen after clear cache.
Also cleanup the codebase.
2024-07-08 16:48:40 +02:00
Benoit Marty
8dae7f2f69 Use session coroutine scope instead of application coroutine scope. 2024-07-08 16:47:17 +02:00
jmartinesp
58f2cbf489 Sync Strings from Localazy 2024-07-03 11:21:27 +00:00
Jorge Martín
16545ce60e Fix session verification incorrectly displaying as 'not verified' when the user opened the app with no network connection.
It turns out `encryptionService.verificationState()` runs a network request that will cause a deadlock when it fails.

Also fixed another deadlock that caused the screen to remain blank sometimes after logging in, because DataStore got stuck when checking the `skipVerification` state for some reason I don't fully understand.
2024-06-28 11:35:08 +02:00
Benoit Marty
038b60a271 Merge pull request #3044 from element-hq/feature/bma/testDefaultClearCacheUseCase
Add test on DefaultClearCacheUseCase
2024-06-18 10:27:45 +02:00
Jorge Martin Espinosa
feef0f6976 Add full screen intent permissions banner (#3024)
* Add full screen intent permissions banner, creating `:libraries:fullscreenintent` modules.
* Add it to notification settings too:
    - Create `libraries:fullscreenintent` modules for the permission presenter and associated data.
    - Add the presenter and states to `NotificationSettingsPresenter` and `NotificationSettingsView`.
* Use the right API to check for full screen intent permissions.
- Use the right package name for `:libraries:permission` contents.
* Fix broken tests (flaky?)
* Ignore coverage verification for fake and small presenters

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-06-18 07:41:10 +00:00
Benoit Marty
cb07ccdeb9 Add test on DefaultFtueService.reset(). 2024-06-17 15:04:20 +02:00
Benoit Marty
2b062f217b Rename method and val. 2024-06-17 14:56:56 +02:00
bmarty
57510316ec Sync Strings from Localazy 2024-06-10 00:17:04 +00:00
Benoit Marty
b3b58f14d7 Remove strings screen_qr_code_login_.* from the ftue module. 2024-06-04 09:42:00 +02:00
bmarty
f501f27d27 Sync Strings from Localazy 2024-06-03 00:24:07 +00:00
Jorge Martin Espinosa
35702c04e9 Sign in with QR code (#2793)
* Add QR code login.
* Add FF to disable it in release mode.
* Force portrait orientation on the login flow.
* Create `NumberedList` UI components.
* Improve camera permission dialog.
* Make nodes in qrcode feature use `QrCodeLoginScope` instead of `AppScope`
* Bump SDK version.
* Fix maestro tests

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-05-31 14:38:27 +02:00
Benoit Marty
17c35885c4 Fix naming issue. 2024-05-31 10:20:43 +02:00
Benoit Marty
a00ee18f96 Add Konsist test Class with 'ContributeBinding' annotation should have allowed prefix and fix exissting issues.
Also remove annotation `DefaultPreferences`, we only have one implementation.
2024-05-31 10:18:08 +02:00
Benoit Marty
cdf6f48112 Change Test class suffix. 2024-05-30 10:11:18 +02:00
Benoit Marty
0e4b30e58d Merge pull request #2941 from element-hq/sync-localazy
Sync Strings
2024-05-29 16:27:17 +02:00
bmarty
46b6ae6251 Sync Strings from Localazy 2024-05-29 12:44:57 +00:00
Benoit Marty
87689d787e Lambda parameters in a composable function should be in present tense, not past tense.
https://mrmans0n.github.io/compose-rules/rules/#naming-parameters-properly
2024-05-29 12:18:23 +02:00
Benoit Marty
9065e9d2eb Merge pull request #2921 from element-hq/sync-localazy
Sync Strings
2024-05-27 15:52:38 +02:00
Benoit Marty
bbb44db297 Translations: pt -> pt-rBR 2024-05-27 14:51:32 +02:00
Benoit Marty
9b07e1cf71 Sync string again (fix lint issue) 2024-05-27 14:47:14 +02:00
bmarty
52be64fe73 Sync Strings from Localazy 2024-05-27 00:17:53 +00:00
Benoit Marty
1459ff0f77 Rename class (code quality) 2024-05-23 14:38:48 +02:00
ganfra
509e080fc2 Merge pull request #2874 from element-hq/feature/fga/fix_2692
Fix modal contents overlapping screen lock pin #2692
2024-05-21 15:53:51 +02:00
ganfra
a1081b39bd Pin : clean up after PR review #2692 2024-05-20 16:34:26 +02:00
bmarty
0241014932 Sync Strings from Localazy 2024-05-20 00:23:05 +00:00
bmarty
602b3988e4 Sync Strings from Localazy 2024-05-13 12:47:48 +00:00
Jorge Martin Espinosa
9aadec8435 Enforce mandatory session verification only for new logins (#2811)
* Enforce mandatory session verification only for new logins

- Creates `AppMigration` base interface as a way to isolate migration logic, app migrations must implement this interface.
- Creates `AppMigration01` with the existing logs removal migration and `AppMigration02` with the logic to allow existing sessions to skip verification.
- Add `DefaultSessionPreferencesStoreFactory.remove(sessionId)` to allow a ephemeral session store access to exist outside the `SessionScope` for this new migration.

* Fix tests

* Add more tests.

This also includes creating several abstractions.

* Review changes.

- Make `orderedMigrations` a class property, `migrations` just a constructor parameter to avoid incorrect usages.
- Create `lastMigration` property too, use it instead of `MIGRATION_VERSION`.
2024-05-07 14:06:34 +00:00
bmarty
d2eb0d9820 Sync Strings from Localazy 2024-05-06 00:19:35 +00:00
Benoit Marty
66cfaf97c9 Open user profile and room with event from permalink 2024-05-02 12:25:21 +02:00
Benoit Marty
76bbbe57ba Remove the FtueEntryPoint.Callback, LoggedInFlowNode is already observing the Ftue state to change the root target. 2024-05-01 13:49:57 +02:00
bmarty
7383ac6678 Sync Strings from Localazy 2024-04-29 00:18:59 +00:00
Jorge Martin Espinosa
fe9b3f7cdb Always display 'lost recovery key?' option (#2745)
* Always display 'lost recovery key?' option

* Use `isLastDevice` it to display only 'enter recovery key' option for verification.

* Update strings. This should fix the wrong term 'passcode' being used in the recovery key screen title.

* Disable 'lost your recovery key?' button while the screen is in a loading state

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-04-25 15:28:24 +02:00
Jorge Martin Espinosa
2cc124bda2 Remove SessionData.needsVerification as the source of truth for session verification status (#2748)
* Remove `SessionData.needsVerification` as the source of truth for session verification status.

- Use the Rust SDK `EncryptionService.verificationState()` instead, but always waiting for the first 'known' result (either verified or not, discarding 'unknown').
- Add a workaround in the super rare case when reading this value gets stuck somehow. We'll assume the user is not verified in that case.
- Make `DefaultFtueService.getNextStep` and dependent checks `suspend`.
- Make the `skip` button use a value in the session preferences instead.

* Log exception when the verification status can't be loaded

Co-authored-by: Benoit Marty <benoit@matrix.org>

* Fix review comments

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-04-24 13:55:25 +00:00
Benoit Marty
d7f0d23634 Merge pull request #2733 from element-hq/feature/bma/disableKnock
Disable knock
2024-04-22 16:22:48 +02:00