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

Redirect loop on /users/edit[/] #10240

Closed
muffinresearch opened this issue Mar 10, 2017 · 9 comments · Fixed by mozilla/addons-frontend#2066
Closed

Redirect loop on /users/edit[/] #10240

muffinresearch opened this issue Mar 10, 2017 · 9 comments · Fixed by mozilla/addons-frontend#2066
Assignees
Labels

Comments

@muffinresearch
Copy link
Contributor

muffinresearch commented Mar 10, 2017

Describe the problem and steps to reproduce it:

From https://github.com/mozilla/addons-frontend/issues/2029#issuecomment-285452339

Whilst the fxa config has been updated to fix the redirection post-registration the redirect loop still exists.

  • Login and click my profile.
  • And then edit profile.
  • Then click "view mobile site" in the footer.
  • addons-frontend starts by serving a 404 for /users/edit/
  • This tells the proxy to let addons-server serve /users/edit/
  • addons-server sees /users/edit/ and redirects to /users/edit
  • addons-frontend sees /users/edit and adds a slash to the end
  • hilarity ensues

What happened?

A redirect loop

What did you expect to happen?

Fallback to /users/edit (we could also not show the "View mobile site" link on this page)
Longer term this will be fixed by added pages for these views in the new mobile site.

@muffinresearch
Copy link
Contributor Author

One way to prevent this behaviour would be to have exclusions for adding slashes.

@muffinresearch
Copy link
Contributor Author

One way to prevent this behaviour would be to have exclusions for adding slashes.

Or another way would be to add a slash on the amo-server side. Might mean we'd need to change the redirect endpoint for server logins to avoid an unnecessary 301.

@kumar303
Copy link
Contributor

We could also put some middleware right at the front of the chain that responds with 404s to known addons-server URLs. However, this could be a little confusing and won't work for when someone is loading pages on the client.

@tofumatt
Copy link
Contributor

QA: we'd love to cherry-pick this patch into this week's tag, so if you could test this and the URLs it should cover (/users/edit, etc.) on -dev and confirm it's working that would be great. ❤️

@ValentinaPC
Copy link

Verified this on AMO-dev FF52(Win 7) while following the first 3 steps (Login and click my profile->click edit profile->click "view mobile site" in the footer) and obtained the following results:

  • default scenario will reload "https://addons-dev.allizom.org/en-US/firefox/users/edit#" page on desktop
    1scenario

  • +Clicking on "Other Applications" like Thunderbird and Seamonkey or My Collections-> addons-frontend starts by serving a 404 page and a Server Error page
    2-scenario

  • +Clicking on "Manage User" from My Profile, "My Themes", "Delete current photo" from Account Settings -> loads a "The page isn’t redirecting properly" page.
    3-scenario

  • +Clicking on "Edit review" link for any comment listed in My Profile page will not work and display an error in the console.
    2017-03-16_1154

Not sure if these scenarios should be taken into consideration.

@muffinresearch
Copy link
Contributor Author

I think there's more scenarios here that aren't working well with the fallback mechanism which are going to cause requests to be sent to the wrong place.

E.g:

If we fallback to the addons-server site and then that page does XHR it will get routed to mobile pages.

@muffinresearch
Copy link
Contributor Author

I'm talking to ops about making a change around the fallback to iron out these problems by using an explicit set of routes that we know the mobile app should respond to.

@tofumatt
Copy link
Contributor

Our routes are much smaller and easier to grok as well. That seems like a better plan 👍

@ValentinaPC
Copy link

ValentinaPC commented Mar 21, 2017

All above scenarios are no longer reproducing.
Verified this as fixed on AMO-dev FF52(Win 7).
Video for this issue:
redirect

Thunderbird and SeaMonkey will load an old mobile -dev page.
Please see video:
t-s

@KevinMind KevinMind added migration:no-jira repository:addons-frontend Issue relating to addons-frontend labels May 5, 2024
@KevinMind KevinMind transferred this issue from mozilla/addons-frontend May 5, 2024
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 a pull request may close this issue.

6 participants