-
Notifications
You must be signed in to change notification settings - Fork 1
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
Local Caching #267
Local Caching #267
Conversation
This reverts commit 72b25f3.
After some testing, storing vanilla js objects and converting to map/set structures is faster than fully stringifying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works so so well and feels way better for the user. One small change requested on the backend.
Other than that, I noticed that when the user reloads we load from the local cache OR the remote store. I'm wondering if there's a case for the AND approach: first load from the local store, then verify with the remote store. Since we're in the single user per map paradigm I figure this approach is fine, but wanted to discuss trade-offs. Thoughts?
backend/app/main.py
Outdated
execute: bool = True, | ||
commit: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: Why these two params? Since you're passing the session from the caller, if the caller errors later all operations in the session's transaction will be rolled back. So you can safely execute this w/o worry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a good call!
Thank you!
That's a good question -- we take this approach for the map views caching (local but verify). I think my two questions here are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user paints before the backend assignments respond, how do we reconcile the state?
Hmm yeah true that would be difficult. You've convinced me that we shouldn't pull.
Another approach might be to do a full document push to the server using the local cache then?
Co-authored-by: Raphael Paul Laude <[email protected]>
Co-authored-by: Raphael Paul Laude <[email protected]>
I believe this is the case currently but will double check tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm – we can leave the push pull discussion for another time / an issue rather than PR
Saw a couple of sentry errors come through. Let's handle those before we merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apparently the above errors were from a local build so re-approving!
This PR adds clientside caching for gerrydb views and zone assignments for better user experience and lighter server loads.
Description
updated_at
sent with update assignment patches to track versioning. This handles asynchronous changes but will not currently alert the FE to changes happening while they are activeupdated_at
property, so this does not change db schemaReviewers
Checklist
Screenshots (if applicable):