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): make sure 404 and 500 pages inherit stateful status from original page #33544

Merged
merged 1 commit into from Oct 18, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Oct 15, 2021

Description

With the way we have our 404 (and now 500) canonical pages setup (/404.html / /500.html) we clone page object from some conventional paths like (/404/) but we don't attach same isCreatedByStatefulCreatePages flag as original page. This required some workarounds (like skipping /404.html when decidiing which pages should no longer be there), but they had some of their own issue. Instead of that if we will guarantee same state on child page then pages cleanup for child page will be the same as parent page and this is what we want instead of workarounds.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 15, 2021
Comment on lines +35 to +36
action.plugin,
action
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We pass third arg (actionOptions) so that this check

isCreatedByStatefulCreatePages:
actionOptions?.traceId === `initial-createPagesStatefully`,
actually do something.

actionOptions are spread on CREATE_PAGE action itself -

{
...actionOptions,
type: `CREATE_PAGE`,
contextModified,
plugin,
payload: internalPage,
},

@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 17, 2021
@pieh pieh merged commit d2329df into master Oct 18, 2021
@pieh pieh deleted the fix/500-weird-deletions branch October 18, 2021 08:48
wardpeet pushed a commit that referenced this pull request Oct 18, 2021
wardpeet pushed a commit to herecydev/gatsby that referenced this pull request Oct 29, 2021
axe312ger pushed a commit that referenced this pull request Nov 9, 2021
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.

None yet

2 participants