-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(lists): Cache lists #59
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Time entry form uses the list cache from Account. - Factor addLog out of useLogs
Important for testing. This forces the time entry to rely on the list cache for its current list state. When the log table is hidden by default, there isn't anything on the page that loads the full collection of logs, and so if the list cache is empty, nothing will fill it. The next step is to detect this case automatically and force-update the cache (with the hope that we only have to query all the logs once, to prime the cache).
- When the list cache is absent, we'll load all the docs once and heal it. - If a list is missing from the cache and we load logs and discover it, we'll add it. - Whenever we add a log, we'll make sure the list is in the cache.
Now we only use the lists from the logs to ensure that the account list cache is up-to-date.
If the account has been created but there aren't any logs, add the default list to ensure it's there.
Also remove the unnecessary, failing loading spinner test.
Visit the preview URL for this PR (updated for commit d5e20a3): https://loggr-a3f89--pr59-cache-lists-18hz8zfp.web.app (expires Sun, 26 May 2024 23:31:47 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: dcba139c17e47dff84a60c5907b98fbd13d724df |
…to see what's wrong.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change adds a
listCache
field to each account, which it uses for the list field on the time entry form and for the list of lists in the log table beneath the time entry form.It also: