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

fix(gatsby): don't show error for proper redirects #19789

Merged
merged 12 commits into from
Apr 28, 2020

Conversation

mnurik
Copy link
Contributor

@mnurik mnurik commented Nov 26, 2019

Description

Changed If statement for showing error message in Development mode, that if there is no such page redirect was intentional.

Related Issues

Fixes #18665

pvdz
pvdz previously requested changes Nov 26, 2019
packages/gatsby/cache-dir/navigation.js Show resolved Hide resolved
@pieh
Copy link
Contributor

pieh commented Nov 26, 2019

I think adding test case for redirects (one that overlap with existing page, and one that tries to redirect from non-existing page) in https://github.com/gatsbyjs/gatsby/tree/master/e2e-tests/development-runtime would help:

  • with establishing how this work
  • making sure we don't introduce regressions

@mnurik mnurik requested a review from pvdz November 26, 2019 23:56
@pvdz
Copy link
Contributor

pvdz commented Nov 28, 2019

@mnurik (Github says you requested a review but I don't see new commits and @pieh's suggestion seems a good way forward. The tests will show us the way. And if you're correct then the current system is broken anyways so it'll be an improvement where a test would be really good to have anyways. Let me know if I missed anything?)

@mnurik mnurik force-pushed the topics/redirect-error-message branch from 7dcf548 to e207475 Compare December 13, 2019 01:06
@mnurik
Copy link
Contributor Author

mnurik commented Dec 13, 2019

@pieh @pvdz I have added e2e tests for redirect one that overlap with existing page, and one that tries to redirect from non-existing page. I couldn't find a way to write tests to check what console errors we have with Cypress.

@pvdz
Copy link
Contributor

pvdz commented Dec 16, 2019

(Triggered a rebase to get the tests passed a breaking commit)

@pieh pieh self-assigned this Dec 16, 2019
@pieh pieh changed the title Inside maybeRedirect function changed error message checking fix(gatsby): don't show error for proper redirects Dec 16, 2019
pieh
pieh previously approved these changes Dec 16, 2019
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @mnurik!

@pieh pieh added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Dec 16, 2019
@pieh pieh removed the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Dec 16, 2019
@pieh pieh dismissed their stale review December 16, 2019 16:48

edge case found

@mnurik mnurik force-pushed the topics/redirect-error-message branch from 34f5563 to 34292e9 Compare January 30, 2020 00:08
@pieh pieh dismissed pvdz’s stale review February 12, 2020 22:18

code was iterated on

@LekoArts LekoArts added the status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response label Feb 25, 2020
@pvdz
Copy link
Contributor

pvdz commented Apr 16, 2020

@mnurik Hi :) Can you please let us know if you're still working on this? I know there's been a lot of back-and-forth but it has been open for a while and no update for over a month so would like to know. Perhaps we should put this PR in Draft mode? (Click "convert to draft" under the reviewers block at the top)

@mnurik
Copy link
Contributor Author

mnurik commented Apr 16, 2020

@pvdz Hi, unfortunately I am not, as @pieh started take care of it, and he changed all the stuff, so I am less familiar with changes than him. So feel free to close it, either @pieh can create separate PR or fix this one.

@pieh
Copy link
Contributor

pieh commented Apr 16, 2020

I'll put this into draft mode for now, because I don't remember status of it - the e2e tests for redirects we added seems to be passing, but also need to keep in mind the tests I added look pretty weird when I look at them right now (and also noted in the comments around them) and I'm not 100% confident they are actually correctly asseting things or not

@pieh pieh marked this pull request as draft April 16, 2020 20:01
@pieh pieh removed the status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response label Apr 28, 2020
@pieh pieh marked this pull request as ready for review April 28, 2020 10:08
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uff, thanks for patience on this. I finished this yesterday and turned out the problems with 404 existing or not were fixed in different PR since this one was opened ( likely in #18051 ) and we just got back to initial code change (+bunch of testing code)

@pieh pieh merged commit 2e6c509 into gatsbyjs:master Apr 28, 2020
@gatsbot
Copy link

gatsbot bot commented Apr 28, 2020

Holy buckets, @mnurik — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. We’ve got Gatsby t-shirts, stickers, hats, scrunchies, and much more. (You can also unlock even more free swag with 5 contributions — wink wink nudge nudge.) See gatsby.dev/swag for details.
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

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

Successfully merging this pull request may close these issues.

What is the good method to configure redirection from / page to another page ?
5 participants