Commit Graph

50 Commits

Author SHA1 Message Date
Benoit Marty
d4c41e38cc Fix flaky test using deterministic awaitFirstItem instead of awaitLastSequentialItem 2024-01-05 09:31:54 +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
Benoit Marty
fcd8562bb9 Use a RetryDialog here, it does not change the rendering, but is more appropriate. 2023-12-26 15:42:44 +01:00
Benoit Marty
eb63c882e1 Add comment to clarify the SteadyException case. 2023-12-26 15:39:56 +01:00
Benoit Marty
fba9788678 Quality 2023-12-26 13:24:59 +01:00
Benoit Marty
9081ba79fa Add test for DefaultDirectLogoutPresenter 2023-12-26 12:38:03 +01:00
Benoit Marty
c65f5ed560 Sign out: direct flow if not last session and if not currently backing up keys #2072
Extract some stuff from existing Logout to avoid duplication.
2023-12-26 12:17:09 +01:00
bmarty
ada357b344 Sync Strings from Localazy 2023-12-26 09:39:48 +01:00
Benoit Marty
e589b97fa5 Attempt to fix test on CI.
The test is failing on CI with this error:
expected instance of: io.element.android.libraries.architecture.Async$Success
but was instance of : io.element.android.libraries.architecture.Async$Loading
with value          : Loading(prevData=null)
2023-12-26 08:32:18 +01:00
Jorge Martín
b739cabbcd Revert "Merge pull request #2071 from element-hq/feature/bma/fixTests"
This reverts commit e49c73188d, reversing
changes made to ba04bbc5ca.
2023-12-22 12:01:42 +01:00
Benoit Marty
fb1de09d73 Last attempt... 2023-12-20 15:13:27 +01:00
Benoit Marty
875cc9adbf Second attempt... 2023-12-20 14:33:16 +01:00
Benoit Marty
badc17531c Attempt to fix test on CI.
The test is failing on CI with this error:
expected instance of: io.element.android.libraries.architecture.Async$Success
but was instance of : io.element.android.libraries.architecture.Async$Loading
with value          : Loading(prevData=null)
2023-12-20 09:15:50 +01:00
Benoit Marty
284b26f332 Attempt to fix test on CI 2023-12-15 19:14:54 +01:00
Benoit Marty
c607552be4 Fix test in release
Be deterministic to try to fix test on CI.
2023-12-15 18:44:39 +01:00
Benoit Marty
6ab07e0cba Fix title of sign out screen regarding the different states 2023-12-15 18:44:08 +01:00
Benoit Marty
d31909e049 Sync localazy using fixed script 2023-12-08 19:24:35 +01:00
Benoit Marty
b43ddd36b9 Run the script again. 2023-12-05 12:25:59 +01:00
bmarty
ad2ca01094 Sync Strings from Localazy 2023-12-04 00:09:56 +00:00
Marco Romano
c6fdc79f83 Upgrade to rust sdk 0.1.71 (#1905)
https://github.com/matrix-org/matrix-rust-components-kotlin/releases/tag/sdk-v0.1.71

There are breaking changes as specified in: https://github.com/vector-im/element-x-android/issues/1898 plus the one related to the poll history feature.
2023-11-29 10:34:51 +01:00
Jorge Martin Espinosa
a8b85fb4e6 Extract compound tokens and theming to compound-android library (#1888)
* Replace tokens & icons with the external Compound ones

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-11-27 10:30:07 +01:00
ElementBot
38f1d9932b Sync Strings (#1789)
Co-authored-by: bmarty <bmarty@users.noreply.github.com>
2023-11-13 12:31:34 +01:00
Benoit Marty
6d8386307b FlowStepPage: make onBackClicked nullable and remove canGoBack. 2023-11-07 10:59:22 +01:00
Benoit Marty
96c81999a3 Rename UserStoryFlowPage to FlowStepPage
Rename UserStoryFlowPage to FlowStepPage
2023-11-07 10:59:22 +01:00
Benoit Marty
c57397792c Let LogoutView use UserStoryFlowPage. 2023-11-07 10:53:21 +01:00
bmarty
6014858aba Sync Strings from Localazy 2023-11-06 08:23:40 +00:00
Benoit Marty
638186ff5a Progress for LinearProgressIndicator and CircularProgressIndicator are now lambdas. 2023-11-02 14:51:42 +01:00
Benoit Marty
323765c3bc Fix maestro test. 2023-11-02 09:23:07 +01:00
Benoit Marty
75a99cf3ba Fix tests 2023-10-31 22:28:59 +01:00
Benoit Marty
8684d23a6d Avoid runBlocking. Start with a nullable boolean. 2023-10-31 21:52:33 +01:00
Benoit Marty
eb82c245ad Secure backup: create a feature flag (disabled) 2023-10-31 21:52:33 +01:00
Benoit Marty
e69390b5b5 Consider keys are backing up only for SteadyStateException.Connection 2023-10-31 21:03:43 +01:00
Benoit Marty
72ba9997a2 Sign out: handle no network error. 2023-10-31 21:03:43 +01:00
Benoit Marty
898392dde2 Map new state BackupUploadState.Error 2023-10-31 21:03:43 +01:00
Benoit Marty
63cf5ef5b1 Merge pull request #1648 from vector-im/feature/bma/secureBackup
Secure backup
2023-10-30 21:29:54 +01:00
Benoit Marty
3b0c51198d Fix test. 2023-10-30 20:16:18 +01:00
Benoit Marty
29e1e9b316 Secure Storage: improve API for waitForBackupUploadSteadyState() 2023-10-30 20:16:18 +01:00
Benoit Marty
4898d8012c Secure backup and sign out: add TopBar with Back button. 2023-10-30 20:16:18 +01:00
bmarty
340a4b5b4f Sync Strings from Localazy 2023-10-30 14:50:36 +00:00
Benoit Marty
bb55a5676c Secure backup 2023-10-27 12:18:40 +02:00
Benoit Marty
b5ffa6eef3 SecureBackup: update matrix sdk module. 2023-10-26 18:02:34 +02:00
Marco Romano
b860bd30bd GRemove the @JvmField annotation whenever using WarmUpRule. 2023-09-13 15:19:26 +02:00
jonnyandrew
301e49c3a3 Reduce test flakiness by warming up molecule tests (#1226) 2023-09-06 10:08:21 +00:00
Benoit Marty
06a9b129d0 Restore OIDC support. 2023-08-23 12:18:42 +02:00
renovate[bot]
6d3b816bf5 Update dependency app.cash.molecule:molecule-runtime to v1 (#925)
* Update dependency app.cash.molecule:molecule-runtime to v1

* Replace `RecompositionClock` with `RecompositionMode`

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2023-07-20 07:36:19 +02:00
Marco Romano
2a82e1b4e4 Async API improvements "v2" (#672)
* Async API improvements "v2"

**NB: This PR actually changes only 3 files in `libraries/architecture/`. All the other changes are automated refactors to fix the calling code.**

This is a proposal for improvements to our `Async` type as discussed in: https://github.com/vector-im/element-x-android/pull/598/files#r1230664392 and in other chats.

Please bear in mind it is just a proposal, I'd love to hear your feedback about it, especially when it comes to naming: I've tried to make parameter and function names use a terminology similar to what we find in the Kotlin stdlib and its `Result` type.

I'm inclined to like more the non-extension flavours of the new `run*` APIs, though I'd also like your feedback about what API shape you prefer.

### Summary of the changes:
#### Functional
- Adds `exceptionOrNull()` API to complement the existing `dataOrNull()` API.
- Adds `isFailure()`, `isLoading()`, `isSuccess()` and `isUninitialized()` courtesy APIs.
- Renames `executeResult()` to `runUpdatingState()`:
	- Becomes the base API to which all the other similarly named APIs call into.
	- Makes it inline.
	- Adds contract.
	- Passes over any `prevData` to newre Async states.
	- Passes through the `block`s return value.
	- Adds unit tests.
- Renames `execute` to `runCatchingUpdatingState()` and makes it just call into `runUpdatingState()`
- Adds extension function overloads to the `run*` functions to accept `MutableState` as receiver

#### Cosmetics
- Reorders classes and methods in alphabetic order.
- Reorder parameter names to mimic conventions in Kotlin stdlib.
- Adds docstrings where useful.

* Use `fold()`

* rename pop to popFirst

* Add docstrings

* Please Detekt

* Rename exception to error.

* Please detekt

* Update existing usages.
2023-06-27 13:37:23 +02:00
Benoit Marty
9321a9f718 Introduce simulateLongTask to ensure that the Presenter State Loading is visible.
Also do some cleanup on the tests.
2023-06-15 10:57:05 +02:00
Florian Renaud
c22d181d8c Remove useless OptIn in tests 2023-05-12 10:05:39 +02:00
ganfra
7051bfc14e [Architecture] split all feature modules to api/impl 2023-03-08 16:13:45 +01:00