fix(gatsby): purge jobsV2 results when cache is corrupt #27700
Merged
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
We consider Gatsby cache to be corrupt when a user deletes the
public
folder but not the.cache
folder. In this case we purge the cache for him (via #27549) and also callDELETE_CACHE
to purge the redux state that is already in memory by this point.But
jobsV2
reducer doesn't clear job cache onDELETE_CACHE
action. This makes sense because sharp jobs can survive.cache
folder removal. But they can't survive thepublic
folder removal (as that's where job results are physically stored).This PR changes the behvaior of
jobsV2
reducer and makes it purge the job cache when the cache is corrupt (so only when thepublic
folder is deleted).Related Issues
Fixes #27699