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

Improve cached asset handling #3201

Merged
merged 3 commits into from
Feb 4, 2021
Merged

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Feb 4, 2021

In #2828 we added caching to asset listings.

Inside the asset query builder it converts paths to asset objects. As part of that, if the asset file doesn't exist, it'll return null.

We discovered an issue where if you delete an asset by hand during the cache window (through the filesystem or by git), you'd get an error because the asset path (which was still in the cache) was converted to null (because the actual file doesn't exist).

We fixed this by filtering out null values when you don't care how many are supposed to be returned.
But when you do care (like when using paginate, or take), we'll check if there are any nulls, if there are we bust the cache and requery.

@jasonvarga jasonvarga marked this pull request as ready for review February 4, 2021 18:20
@jasonvarga jasonvarga merged commit 1d41d6d into 3.0 Feb 4, 2021
@jasonvarga jasonvarga deleted the fix/asset-null-caching-busting branch February 4, 2021 19:18
@jsblair9
Copy link
Contributor

jsblair9 commented Feb 5, 2021

amazing 🙌🏼 was just working through this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants