Issue/1482 step2 magic link signin changes#1498
Conversation
Error TypeErrorDangerfileError TypeErrorDangerfileGenerated by 🚫 dangerJS |
…e/1482-step2-magic-link-signin-changes
|
You can test the changes on this Pull Request by downloading the APK here. |
…github.com/woocommerce/woocommerce-android into issue/1482-step2-magic-link-signin-changes
There was a problem hiding this comment.
@anitaa1990 Nice work on all of this! I've finished my first review and have left some comments in the code, plus the following:
Design Comments
Changes to the magic link view for the self-hosted flow has also changed the magic link view for the normal flow. Was this intentional? If I don’t use my self-hosted auth credentials and just do the normal flow of logging in with my WPcom creds, I see this:
...which feels wrong in this context since we're logging in and not just verifying an email address. cc: @kyleaparker for clarification.
Crash
Error while trying to logout:
AndroidRuntime D Shutting down VM
E FATAL EXCEPTION: main
E Process: com.woocommerce.android.dev, PID: 10933
E org.greenrobot.eventbus.EventBusException: Invoking subscriber failed
E at org.greenrobot.eventbus.EventBus.handleSubscriberException(EventBus.java:527)
E at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:509)
E at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:501)
E at org.greenrobot.eventbus.HandlerPoster.handleMessage(HandlerPoster.java:67)
E at android.os.Handler.dispatchMessage(Handler.java:106)
E at android.os.Looper.loop(Looper.java:193)
E at android.app.ActivityThread.main(ActivityThread.java:6669)
E at java.lang.reflect.Method.invoke(Native Method)
E at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
E at android.content.ComponentName.<init>(ComponentName.java:130)
E at android.content.Intent.<init>(Intent.java:6082)
E at com.woocommerce.android.ui.login.MagicLinkInterceptFragment.showLoginScreen(MagicLinkInterceptFragment.kt:102)
E at com.woocommerce.android.ui.login.MagicLinkInterceptPresenter.onAuthenticationChanged(MagicLinkInterceptPresenter.kt:60)
E at java.lang.reflect.Method.invoke(Native Method)
E at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:507)
E ... 8 moreTo reproduce:
1. Login with magic link (doesn’t matter which flow)
2. After successful login, log out.
3. Crash.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptContract.kt
Outdated
Show resolved
Hide resolved
...dPressLoginFlow/src/main/java/org/wordpress/android/login/LoginMagicLinkRequestFragment.java
Outdated
Show resolved
Hide resolved
Yes the copy should be different in the two different scenarios |
|
Thanks for the thorough review @AmandaRiu
I've fixed this in a5321d2
I haven't been able to reproduce this, for some reason. I tried logging in via the normal flow and the self hosted flow and both times it was successful 🤔 I've made some changes to the flow so perhaps it's fixed? Could I trouble you to let me know if you are able to reproduce this now? PR ready for another round 👍 |
…e/1482-step2-magic-link-signin-changes
AmandaRiu
left a comment
There was a problem hiding this comment.
@anitaa1990 Looking great! The conversion to MVVM is so nice! I've only left a few code comments - once addressed this should be ready to merge 👍
Oh and Im no longer able to reproduce that crash either. Maybe the switch to MVVM fixed it.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptRepository.kt
Outdated
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptViewModel.kt
Outdated
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptFragment.kt
Outdated
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptFragment.kt
Outdated
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptRepository.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptRepository.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptRepository.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptRepository.kt
Show resolved
Hide resolved
|
Thanks for the review @AmandaRiu.
Since we need the I've fixed the code changes requested and PR is ready for another round 👍 |
AmandaRiu
left a comment
There was a problem hiding this comment.
Since we need the ViewModelModule and ThreadModule across multiple activities now (MainActivity and LoginActivity) and we might in the future use the same modules if we migrate from MVP to MVVM for the site picker or settings screen, I thought it made more sense to move these two to AppComponent
Makes perfect sense to me! Changes look great...beautiful work! ![]()

Partially fixes #1482. This PR completes the second step of the Jetpack sign in with self credentials as defined in the master thread.
Changes
LoginMagicLinkRequestFragmentandLoginMagicLinkSentFragmentaccording to new design.MagicLinkInterceptFragmentthat handles the magic link login process. This was previously handled by theMainActivity. This logic has been migrated to the new class.Behaviour
(LEFT: Before . RIGHT: After)
. 
Notes:
Testing:
Update release notes:
RELEASE-NOTES.txtif necessary.