-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move session verification to FTUE flow, make it mandatory #2594
Move session verification to FTUE flow, make it mandatory #2594
Conversation
9b69e62
to
6dac601
Compare
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2594 +/- ##
===========================================
- Coverage 73.37% 73.37% -0.01%
===========================================
Files 1459 1458 -1
Lines 35177 35151 -26
Branches 6752 6746 -6
===========================================
- Hits 25812 25792 -20
+ Misses 5851 5848 -3
+ Partials 3514 3511 -3 ☔ View full report in Codecov by Sentry. |
Workaround issue with cancellation not working most of the time
67fc5ef
to
3c9bf50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, I just have some remarks.
val pushProvider = pushService.getAvailablePushProviders().firstOrNull() ?: return@LaunchedEffect | ||
val distributor = pushProvider.getDistributors().firstOrNull() ?: return@LaunchedEffect | ||
pushService.registerWith(matrixClient, pushProvider, distributor) | ||
val verifiedStatus by sessionVerificationService.sessionVerifiedStatus.collectAsState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better like this?
val isVerified by remember {
verificationService.sessionVerifiedStatus.map { it == SessionVerifiedStatus.Verified }
}.collectAsState(initial = false)
LaunchedEffect(isVerified) {
@@ -398,20 +393,23 @@ class LoggedInFlowNode @AssistedInject constructor( | |||
} | |||
} | |||
|
|||
suspend fun attachRoot(): Node { | |||
return attachChild { | |||
suspend fun attachRoot() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename Root
to RoomList
// Attach the root node as soon as we know the first session verification status and the FTUE shouldn't be displayed. | ||
// This prevents the room list from being displayed while the session is not verified. | ||
combine( | ||
sessionVerificationService.sessionVerifiedStatus, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit strange to do that. I'd let the FtueState
exposes a Loading state instead.
(maybe we should rename FtueState
to be FtueService
and have a proper FtueState
because it's a bit misleading currently).
You could replace everything by something like this afterwards
ftueFlow
.onEach { ftueState ->
when(ftueState){
FtueState.Loading -> Unit // don't do anything, Placeholder is the default node. If app is killed we don't want to loose our current navigation state.
is FtueState.Loaded -> {
if(ftueState.isCompleted){
backstack.safeRoot(NavTarget.RoomList)
} else {
backstack.safeRoot(NavTarget.Ftue)
}
}
}
}
- Renamed `FtueState` to `FtueService`, created an actual `FtueState`. - Minor improvements.
…-session-verification-to-ftue-flow
Thanks for the review! I believe ad4ffb2 should fix all those issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, LGTM!
116ad5a
to
48670e1
Compare
48670e1
to
525eb67
Compare
Quality Gate passedIssues Measures |
Type of change
Content
Motivation and context
Closes #2580.
Screenshots / GIFs
verification-in-ftue.webm
Tests
Tested devices
Checklist