Skip to content
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

Jetpack connect: avoid showing a generic error message #5012

Merged
merged 1 commit into from
Apr 27, 2016

Conversation

johnHackworth
Copy link
Contributor

If we are have just authorized a jetpack site, and we reload the page (or just go to the next screen and the go back to the authorization screen), right now we are going to see a "unknown error" message.
image

This is because we are trying to authorize the site again, and the API is returning an "already authorized" message, which is not controlled so it defaults to the default generic error message.

This PR changes this, so we can show an "already authorized" message:
image

How to test

  1. Go to http://calypso.localhost:3000/jetpack/connect/ and enter an unconnected jetpack site url
  2. Wait until your site is connected, by then you should be at http://calypso.localhost:3000/jetpack/connect/authorize
  3. Reload the page (or go to the plans page and the click browser's back button). You should see a message telling you tha te site is already connected, not an error message

@roccotripaldi @rickybanister

@johnHackworth johnHackworth self-assigned this Apr 26, 2016
@johnHackworth johnHackworth added Jetpack [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 26, 2016
@johnHackworth johnHackworth added this to the Jetpack-Connect m1 milestone Apr 26, 2016
@rickybanister
Copy link

Could we perhaps redirect the user to the next step instead? (or something like that?)

@johnHackworth
Copy link
Contributor Author

@rickybanister we could do that... but pretty much that will mean that the user could not use the browser back button (also: confusing and infuriating as hell... as least for me as a user, I hate when I'm trying to go back in my browsing history and a site insists in forwarding me to the next step)

@roccotripaldi
Copy link
Member

LGTM!

This made me realize that we need to handle cases where people manually go to /jetpack/connect/authorize by typing it into their address bar. We should probably just kick them back to jetpack/connect - I'll handle that in an other PR.

@roccotripaldi roccotripaldi added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 26, 2016
@rickybanister
Copy link

@johnHackworth understood. Perhaps then we render a different set of components here or something.

How would someone navigate to here in the first place? Would they have to type in that url?

What about rendering a drake message saying you're already connected?

@johnHackworth
Copy link
Contributor Author

johnHackworth commented Apr 26, 2016

@rickybanister this is the url where users are redirected to from their wp-admin ...
so for them, it's /jetpack/connect => /jetpack/connect/authorize =>
/plans ... and this PR deals with what happens if they go back from
/plans to /authorize.

I don't think we could render a different set of components since when we
start rendering this page we don't really know if the user is there for the
first time or if they are back from /plans (or have reloaded the page).
What we could do is, once we try to connect the site and we identify the
site as already connected, show a drake message there instead of the auth
screen, maybe

@johnHackworth
Copy link
Contributor Author

@rickybanister I'm going to merge this one, to avoid the error message, and we can add the drake screen in another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants