-
Notifications
You must be signed in to change notification settings - Fork 731
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
FTUE - Only override sign up steps for matrix.org
#6065
Conversation
….org is selected - lifts the logic up to the view model
Unit Test Results122 files ±0 122 suites ±0 2m 14s ⏱️ -5s Results for commit 5f2cb67. ± Comparison against base commit 955f366. This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
matrix.org
matrix.org
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.
LGTM, one small remark.
Also having a first time look on FtueMissingRegistrationStagesComparator
, I am wondering if we could use compareTo
instead of doing a subtraction, as per https://github.com/vector-im/element-android/blob/main/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SsoIdentityProvider.kt#L63.
Warning, it could reverse the order (I never know :) )
} | ||
|
||
private fun OnboardingViewState.hasSelectedMatrixOrg() = selectedHomeserver.userFacingUrl == matrixOrgUrl | ||
|
||
private fun FlowResult.overrideOrder() = copy(missingStages = missingStages.sortedWith(FtueMissingRegistrationStagesComparator())) |
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's strange that this extension is actually doing a copy
of the state. I would keep the copy
at the call site.
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.
will inline 👍
can do 👍 (and the test confirms it's the same order https://github.com/vector-im/element-android/blob/develop/vector/src/test/java/im/vector/app/features/onboarding/ftueauth/FtueMissingRegistrationStagesComparatorTest.kt#L31) |
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 update! One final non blocking remark.
@@ -18,10 +18,10 @@ package im.vector.app.features.onboarding.ftueauth | |||
|
|||
import org.matrix.android.sdk.api.auth.registration.Stage | |||
|
|||
class FtueMissingRegistrationStagesComparator : Comparator<Stage> { | |||
class MatrixOrgMissingRegistrationStagesComparator : Comparator<Stage> { |
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.
Nit: thinking again about the name of this class, I think the word Missing
could be removed.
@@ -25,7 +25,7 @@ import im.vector.app.test.fixtures.anOtherStage | |||
import org.amshove.kluent.shouldBeEqualTo | |||
import org.junit.Test | |||
|
|||
class FtueMissingRegistrationStagesComparatorTest { | |||
class MatrixOrgMissingRegistrationStagesComparatorTest { |
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.
Same remark about the name here then
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.
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.
Perfect, thanks!
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.
All good for me, thanks!
Matrix SDKIntegration Tests Results:
|
Type of change
Content
Fixes #5783 (First iteration #5785)
Only overrides the order of the sign up flow if the selected server is
matrix.org
Motivation and context
Ultimately we want the homeserver to control the sign up flow however until this capability easily exists, we'll override only matrix.org's order from the client side and gather feedback.
Screenshots / GIFs
Tests
Tested devices