-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Conversation
action.plugin, | ||
action |
There was a problem hiding this comment.
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
gatsby/packages/gatsby/src/redux/actions/public.js
Lines 397 to 398 in 83396a5
isCreatedByStatefulCreatePages: | |
actionOptions?.traceId === `initial-createPagesStatefully`, |
actionOptions
are spread on CREATE_PAGE
action itself -
gatsby/packages/gatsby/src/redux/actions/public.js
Lines 492 to 498 in 83396a5
{ | |
...actionOptions, | |
type: `CREATE_PAGE`, | |
contextModified, | |
plugin, | |
payload: internalPage, | |
}, |
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 sameisCreatedByStatefulCreatePages
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.