fix(gatsby-plugin-page-creator): Track correct knownPagePaths
#37745
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug in the development server where pages that are deleted and re-created in the data layer don't actually have their pages re-created if the user has
trailingSlash: always
, either explicitly or as the default. The issue seems to stem fromknownPagePaths
being passed a path generated without regard for thetrailingSlash
option when creating a page, but checks for the actual path of the page that does respecttrailingSlash
when deleting.Documentation
No features change from this bugfix, so I don't think any new documentation is needed.
Tests
No automated tests yet, I manually tested in a minimal project that was suffering from this issue by rearranging stuff in dist.
Quick screencasts of manual changes with console logs:
Current:
page-path-bug-demo.mp4
With fix:
page-path-bug-fix-demo.mp4
Related Issues
Didn't make an initial issue and I can't find anything related by searching "create page"