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

refactor garbage collection to use destination path as well as source path #74

Closed
jeffschwartz opened this issue Jul 7, 2019 · 0 comments
Assignees
Labels
bug Something isn't working generator related Issue is generator related incremental build related Issue is incremental build related
Milestone

Comments

@jeffschwartz
Copy link
Contributor

jeffschwartz commented Jul 7, 2019

When a user changes a blog article's category, garbage collection fails to delete the original article.

Garbage collection currently handles identifying target pages that are no longer generated by comparing cached stats to new stats, specifically by their source paths.

Garbage collection, however, does not currently handle identifying orphaned pages that are the result of the user changing the categories associated with articles. This results in the generation of duplicate articles located at their new paths reflecting their new categories and the failure of garbage collection to remove the original articles located at the paths reflected by their previous categories.

To correct this issue, all targets for garbage collection must be determined after getAllMetadata has been called. This will then allow for also comparing the current stat's destination path to the cached stats destination path. If they aren't the same then garbage collection will target the cached stat's destination path for removal.

@jeffschwartz jeffschwartz added bug Something isn't working generator related Issue is generator related incremental build related Issue is incremental build related labels Jul 7, 2019
@jeffschwartz jeffschwartz added this to the v1.0.0-rc.4 milestone Jul 7, 2019
@jeffschwartz jeffschwartz self-assigned this Jul 7, 2019
@jeffschwartz jeffschwartz changed the title blog article pages aren't being garbage collected when their categories are changed refactor garbage collection to use destination path as well as source path Jul 7, 2019
jeffschwartz added a commit that referenced this issue Jul 7, 2019
failing to identify targets for removal when user
changes the category of an article
jeffschwartz added a commit that referenced this issue Jul 8, 2019
failing to identify targets for removal when user
changes the category of an article
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working generator related Issue is generator related incremental build related Issue is incremental build related
Projects
None yet
Development

No branches or pull requests

1 participant