-
Notifications
You must be signed in to change notification settings - Fork 79
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
State gets confused after moving, deleting, uploading files. #809
Comments
Seems like this could be a race condition. Replacing Could be that the mutation is not completed before the state is refetched, but that would be strange as this is invoked in the success handler. [Edit] Maybe this is related? apollographql/apollo-client#1821 |
The problem is that we are not updating the cache manually after the move file/delete file mutations. We need to ensure the cache is always up to date. This becomes tricky with the move file mutation as we can easily write the updated query to GraphQL, but with the pagination, sorting and search filters we would need to write every combination of these variables to the updated query. This is not a viable option and it does not look like Apollo GraphQL has a way for us to clear the cache for a specific query regardless of the variables provided. Discussions around caching invalidation:
The closest option would be to clear the store itself or just prevent the readFilesQuery from using the cache by setting the |
…iles Apollo GraphQL does not currently have a way to invalidate cache without clearing the whole store Fixes silverstripe#809
…iles Apollo GraphQL does not currently have a way to invalidate cache without clearing the whole store Fixes silverstripe#809
…iles Apollo GraphQL does not currently have a way to invalidate cache without clearing the whole store Fixes silverstripe#809
…iles Apollo GraphQL does not currently have a way to invalidate cache without clearing the whole store Fixes silverstripe#809
Asset-admin has an annoying tendency to mix up its state when doing file operation. Which leads to ghost file entries.
Here's a couple examples:
PR's
The text was updated successfully, but these errors were encountered: