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

Improve realtime event handling in figbird #42

Open
KidkArolis opened this issue Jan 11, 2023 · 0 comments
Open

Improve realtime event handling in figbird #42

KidkArolis opened this issue Jan 11, 2023 · 0 comments

Comments

@KidkArolis
Copy link
Collaborator

At the moment we mount realtime event handlers with each query and stop listening to them once that component is unmounted, this can cause data integrity issues. Instead we should maybe have one central listener that listens to all events and updates the cache.

One edge case to handle here is the queries that use "refetch" mode, it would be wasteful to refetch such queries in the background if their not mounted. Ingesting a realtime event into cache (hit or miss) is cheap. But doing refetches is expensive and should only be done if relevant for the current screen. Having said that, refetches are rare, and perhaps it's ok if the data is not fresh for queries using refetch mode, the integrity issue should be handled by guarding etc. in those rare cases where refetch is being used. A bit leaky, but might be the case of good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant