-
Notifications
You must be signed in to change notification settings - Fork 68
#114 WIP collection cache #285
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
Conversation
So the thing I'm currently struggling with, is performing the cached query. Currently, Edit: ended up making the |
Having some trouble with conditionally reversing the let iter = if q.sort_desc {
store.members_index.range(start_key..end_key)
} else {
store.members_index.range(start_key..end_key).rev()
}; Fails, because
So I read about using let iter = if q.sort_desc {
Box::new(store.members_index.range(start_key..end_key))
} else {
Box::new(store.members_index.range(start_key..end_key).rev())
}; Fails:
|
The changing data test is failing, because the cache is not properly invalidated. We have this logic, that checks an update atom according to query filters that are being watched:
But... That goes wrong when the sorted value differs from the filtered value. So let's say we have a We should first check if the Maybe the problem is more fundamental. The Flip itSay we want to check if an atom will match things. We could first check if the resource matches the query filter. If that is the case, we can continue, and perform the existing checks. |
So the previous cache invalidation issue has now been solved by passing the old resource to the cache invalidation logic. It is needed to match the Things are working fine if a commit is only applied once, but for the |
I think atoms for the Let's consider I want add a Paragraph to a Document. ReferenceIndex
QueryIndex
SolutionI think we need to have two value fields in a QueryAtom: both a Filtervalue and a Sortvalue. Or we should accept that we can't sort by count. Which is also acceptable. |
I think I finally know what is causing my last failing test: |
Tests are green! I think I'll merge this soon. But first, I'll look for some extra things to break, test and fix. |
TODO:
.unwrap()
inupdate_member
closuresPR Checklist: