-
Notifications
You must be signed in to change notification settings - Fork 868
FTUE - Homeserver sign in/up deeplinks #6036
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
Conversation
|
|
||
| @Provides | ||
| @Singleton | ||
| fun providesBuildMeta() = BuildMeta() |
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.
Introduces a build meta abstraction to allow for providing Build version overrides for unit tests
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.
Awesome idea!
| } | ||
| } | ||
|
|
||
| private fun LoginConfig?.toHomeserverConfig(): HomeServerConnectionConfig? { |
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.
no longer needed as the SelectHomeserver will read from the deeplink or default to matrix.org
| onHomeServerSelected(config, serverTypeOverride, authResult) | ||
| } | ||
| is OnboardingAction.HomeServerChange.EditHomeServer -> { | ||
| when (awaitState().onboardingFlow) { |
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.
the when clauses of when (trigger) have been extracted to their own functions
| } | ||
| OnboardingFlow.SignIn -> { | ||
| updateServerSelection(config, serverTypeOverride, authResult) | ||
| _viewEvents.post(OnboardingViewEvents.OnLoginFlowRetrieved) |
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.
this case was a legacy flow which has been removed by providing stronger typing to onAuthenticationStartedSuccess( trigger: OnboardingAction.HomeServerChange)instead of the baseOnboardingAction`
| // Nothing to do | ||
| } | ||
|
|
||
| override fun onError(throwable: Throwable) { |
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.
this is now handled by the activity(/FtueVariant)
| import org.matrix.android.sdk.api.network.ssl.Fingerprint | ||
|
|
||
| sealed interface OnboardingAction : VectorViewModelAction { | ||
| data class OnGetStarted(val resetLoginConfig: Boolean, val onboardingFlow: OnboardingFlow) : OnboardingAction |
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.
resetLoginConfig has become a dedicated reset action ResetDeeplinkConfig
a0fcef6 to
8c44c98
Compare
…erver - also fixes the usecase screen becoming stuck with an invalid homeserver deeplink
…s with breaking down UnknownHost exceptioncauses and shouldn't be used for checking offline status
- the viewmodel is now responsible for inferring connectivity errors and providing a retry action
…uild version checks
48f0303 to
86c9e60
Compare
| // Nothing to do | ||
| } | ||
|
|
||
| override fun onError(throwable: Throwable) { |
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.
handled by the FtueVariant -> OnboardingViewEvents observer
ericdecanini
left a comment
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
|
|
||
| @Provides | ||
| @Singleton | ||
| fun providesBuildMeta() = BuildMeta() |
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.
Awesome idea!
| */ | ||
| @Suppress("deprecation") | ||
| @SuppressLint("NewApi") // false positive | ||
| fun Context.inferNoConnectivity(buildMeta: BuildMeta): Boolean { |
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.
Should we add a description about buildMeta parameter?
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 add some java doc 👍
| networkCapabilities?.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) == true -> false | ||
| networkCapabilities?.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) == true -> false | ||
| networkCapabilities?.hasTransport(NetworkCapabilities.TRANSPORT_VPN) == true -> false | ||
| else -> true |
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.
This might be a silly question/use case but should we check the internet connection over TRANSPORT_ETHERNET and TRANSPORT_BLUETOOTH?
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 catch! I will double check if hasTransport considers bluetooth as an internet provider or simply if a bluetooth connection is present
onurays
left a comment
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, just one remark.
|
ahh sorry @onurays I merged too soon, I will address your comments in another PR |
Matrix SDKIntegration Tests Results:
|
Type of change
Content
ViewModelMotivation and context
Fixes #6023
Screenshots / GIFs
Legacy flows
FTUE flows
Offline deeplink
Tests
Tested devices