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

Introduce manual flow fallback on invalid credentials #8426

Merged
merged 5 commits into from Oct 19, 2018

Conversation

Projects
None yet
2 participants
@planarvoid
Contributor

planarvoid commented Oct 15, 2018

Fixes: #8425

We're starting the Jetpack manual installation flow whenever we receive one of the expected errors (FORBIDDEN, INSTALL_FAILURE, INSTALL_RESPONSE_ERROR, LOGIN_FAILURE, INVALID_CREDENTIALS, ACTIVATION_ON_INSTALL_FAILURE, ACTIVATION_RESPONSE_ERROR, ACTIVATION_FAILURE) error when we hit the Jetpack remote install endpoint. This should improve success rate of the Jetpack installation flow.

As an additional step I'm adding tracking events to everything happening on the screen so we have a better idea about what's failing for the users.

Whenever we receive the error SITE_IS_JETPACK, I start the Jetpack connection.

To test - first try to reproduce with current release:

  • set up a self-hosted site without Jetpack
  • setup reCaptcha plugin on the site
  • connect in the app with the self-hosted site
  • go to Stats
  • click on Install Jetpack
  • Instead of failure you get redirected to the original manual flow
  • Complete the flow

@planarvoid planarvoid added the Jetpack label Oct 15, 2018

@planarvoid planarvoid added this to the 11.1 milestone Oct 15, 2018

@planarvoid planarvoid self-assigned this Oct 15, 2018

@planarvoid planarvoid requested review from 0nko and theck13 Oct 15, 2018

@@ -1256,8 +1268,6 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) {
return "installation_referrer_failed";
case OPENED_PAGE_PARENT:
return "page_parent_opened";
default:

This comment has been minimized.

@planarvoid

planarvoid Oct 18, 2018

Contributor

All the cases should always be covered, this only makes the switch error prone.

@planarvoid planarvoid requested a review from malinajirka Oct 18, 2018

@malinajirka malinajirka self-assigned this Oct 19, 2018

@malinajirka

Thanks @planarvoid ! LGTM. I've left just one comment (super minor nitpick).

)
mutableViewState.postValue(Error { startRemoteInstall(site) })
when {
event.error?.apiError == SITE_IS_JETPACK -> {

This comment has been minimized.

@malinajirka

malinajirka Oct 19, 2018

Contributor

Nitpick -
we should probably change this event.error?.apiError == SITE_IS_JETPACK to SITE_IS_JETPACK.contains(event.error?.apiError) to be consistent with other cases.

This comment has been minimized.

@planarvoid

planarvoid Oct 19, 2018

Contributor

the other case is a list of other errors, it's not String.contains. Do you think it still makes sense?

This comment has been minimized.

@malinajirka

malinajirka Oct 19, 2018

Contributor

ohh, ok 👍

@malinajirka malinajirka merged commit 8b2722a into develop Oct 19, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
danger/danger All green. Nice work.

@malinajirka malinajirka deleted the introduce_manual_flow_fallback_on_invalid_credentials branch Oct 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment