Skip to content

Conversation

@rogermparent
Copy link
Contributor

@rogermparent rogermparent commented Mar 13, 2023

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 from knownPagePaths being passed a path generated without regard for the trailingSlash option when creating a page, but checks for the actual path of the page that does respect trailingSlash 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"

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 13, 2023
@LekoArts LekoArts changed the title Use modifiedPath instead of path in knownPagePaths fix(gatsby-plugin-page-creator): Track correct knownPagePaths Mar 14, 2023
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Thank you! This is quite a subtle bug so appreciate the PR :)

This will be released in stable Gatsby in a week, I'll publish gatsby@next later today with this fix though already.

@LekoArts LekoArts added topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 14, 2023
@LekoArts LekoArts merged commit b121057 into gatsbyjs:master Mar 14, 2023
@rogermparent rogermparent deleted the fix-knownPagePaths-trailingSlash branch March 14, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants