Property in Query Filter & Cache Invalidation
Hello!
Because of the great work Convex does at keeping information up-to-date, my app UI has a weird experience that I'm trying to figure out the best solution for solving.
It is a "Tinder-like" experience where there is a stack of cards (react-native-deck-swiper) and a user can swipe left or down to remove a card from the stack. When this happens, the query cache is invalidated because the status of the card (a property selected in the query and used in filtering the cards during the query) is updated for this single card. Therefore, the cards are shuffled back to the original order which is annoying.
Two questions:
- If the card is used only as a filtering property (i.e. not selected to return), would this same behavior exist, i.e. the cache invalidation and re-pulling of the data?
- If the property was in a separate dedicated table, but still used in the same way (filtering), would this behavior continue?
Any thoughts would be helpful! 🙏🏻
2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
It sounds like whatever state you're using for tracking the currently viewed card is being reset when the data changes, should be able to change the dependency in your frontend to avoid this