Commit Graph

37 Commits

Author SHA1 Message Date
Benoit Marty
7ea2f28d96 More log about Node lifecycle. Will help to track user navigation. 2023-07-12 12:01:54 +02:00
ganfra
b72313bc84 Nodes: rework RootFlowNode with cache service 2023-07-06 18:08:29 +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
Marco Romano
924103521f Inline Async extension functions (#598)
Just a tiny perf improvement.
2023-06-15 12:53:11 +02:00
Benoit Marty
4d8aaecf67 Add comment. 2023-06-01 17:58:12 +02:00
ganfra
b0152059ff Room : continue improving members loading 2023-04-21 14:39:47 +02:00
ganfra
a166636060 Add some tests on RoomFlowNode 2023-04-14 15:34:41 +02:00
Jorge Martin Espinosa
d7a6779343 [Room member list] Display room member list (#276)
* Implement room member list

* Move timeline initialization back to `TimelinePresenter`.

* Fix crash when the `innerRoom` inside a `RustMatrixRoom` is destroyed but `syncUpdateFlow` is still running.

* Address review comments
2023-04-04 16:07:57 +00:00
Jorge Martin Espinosa
f94d2b6c60 Handle 'invalid server' error in server selection screen properly. (#214)
* Handle 'invalid server' error in server selection screen properly.

* Use `action_learn_more` for composing the server location footer action.
2023-03-21 09:34:14 +01:00
ganfra
399bfdc5e6 Add small comments 2023-03-09 17:54:35 +01:00
ganfra
b2c68d555a [Architecture] introduce nodeBuilder concept 2023-03-07 20:31:16 +01:00
ganfra
43b304e523 Try splitting messages into api and impl modules 2023-03-03 14:38:05 +01:00
ganfra
c581f0b383 [Architecture] introduce BackstackNode 2023-03-02 17:55:26 +01:00
ganfra
15ed58b756 [Architecture] use FeatureEntryPoint on Preferences 2023-03-02 15:59:25 +01:00
ganfra
da92113e43 [Architecture] Introduce EntryPoint and use createNode for ParentNode too 2023-03-02 12:33:18 +01:00
Benoit Marty
0b6d7b0bc5 Add test for ChangeServerPresenter 2023-02-07 16:57:33 +01:00
ganfra
bfb508ba1d Remove PresenterConnector and molecule runtime in feature modules, directly call Presenter.present method 2023-02-01 15:56:07 +01:00
Benoit Marty
15700062c7 Rename function (code review) 2023-01-25 11:14:50 +01:00
Benoit Marty
7e2fd638e4 Animation between screens 2023-01-24 17:24:40 +01:00
ganfra
c6cfe2b5e2 Rename di module 2023-01-20 17:12:40 +01:00
ganfra
528c01199d Rename architecture module 2023-01-20 16:26:43 +01:00
ganfra
bdcfe98aab Changes after review 2023-01-19 15:26:06 +01:00
ganfra
3a6be5f745 Merge branch 'develop' into feature/fga/presenter_tests 2023-01-18 20:47:15 +01:00
ganfra
1f2a9026ea Add some refactoring and first simple test on RoomListPresenter 2023-01-18 17:57:34 +01:00
Benoit Marty
66a389c4c5 Rename folders java to kotlin 2023-01-18 13:51:30 +01:00
ganfra
0fc8ed9b33 Fix detekt 2023-01-16 18:17:56 +01:00
ganfra
1919058aac Apply ktlint format 2023-01-13 18:37:28 +01:00
ganfra
b286b8bf9d Add copyright on new files 2023-01-13 18:36:16 +01:00
ganfra
3abba8e88f Remove viewmodel/fragment references 2023-01-13 18:20:10 +01:00
ganfra
c2643d0967 Remove SharedFlowHolder 2023-01-11 17:09:14 +01:00
ganfra
1a0c9df1da Use EventSink lambda in state instead of Flow in Presenter 2023-01-11 15:53:52 +01:00
ganfra
56e54bb172 Continue migrating BugReport/Rageshake/Crash screens 2023-01-10 21:18:16 +01:00
ganfra
7edfcac62b Migrate Preferences to new architecture 2023-01-09 19:27:28 +01:00
ganfra
7d65a4a1e7 Merge branch 'develop' into feature/fga/navigation First step: makes it compile by disabling the new screens (need to migrate to nodes) 2023-01-06 19:22:52 +01:00
ganfra
9ed208950e Migrate Login to new architecture and make some adjustments 2023-01-06 15:15:45 +01:00
ganfra
9365dc0e74 Use LifecycleOwner instead of explicit Node on presenterConnector 2023-01-05 10:59:26 +01:00
ganfra
7fc69a70da Move some code to 'architecture' module 2023-01-04 21:09:59 +01:00