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

Warning - smilestore.data may not finish syncing before page loads (subsequent problems with browser refreshing) #81

Open
rhezab opened this issue Aug 14, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rhezab
Copy link

rhezab commented Aug 14, 2023

see linked code snippet - https://github.com/NYUCCL/smile/blob/ba3239653faca5d5fc9e17cfcb05adace01cf7d8/src/router.js#L203C1-L206C6

loadData might not finish before the page is reloaded, potentially causing problems if your page proeprly loading depends on smilestore.data being synced with firestore (if not synced, it resets to initial values). In particular, it caused problems for me when browser refreshes.

Using await in front of loadData fixes this for me. Unclear if this should also be done in main template, since it could cause latency if loadData is not needed for page loading, but maybe good to document regardless.

@rhezab rhezab added the bug Something isn't working label Aug 14, 2023
@rhezab rhezab self-assigned this Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants