Proper Validation to getting all data created in the last week with `.withIndex` and pagination
I'm using luxon to do time calculations, and this is first time I've run into this issue,
I have a
usePaginatedQuery
imported from cache provider from convex-helpers with next.js latest, and I'm running the following query below, the userId is coming from the ctx, and the DateTime is coming from luxon, built on top of index,
when I add the last gte
for the field _creationTime
I get an infinite loop on my frontend
Error: Too many re-renders. React limits the number of renders to prevent an infinite loop.
I've tested the query and its working for a sure, but somehow its causing my frontend to overreact,
9 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!
also just looked at my dashboard
I'm not passing cursor, could it be because of the caching?

Can you share the code where you're calling this in the client
I'm 60% sure its coming from the cached cursor
googles "reactuses"
Ah gotcha
I'd try regular usePaginatedQuery to confirm
nah its just basically a useRef that's updated on first mount
well I kinda need it to be cached atm, if it keeps crashing I'd change it back
I mean just to try it and confirm whether the caching is your only problem
uh, then it was deff related to the cached cursor, I'm able to re-produce it when I update a mutation, but not on viewing elements this time

I guess I'm using the other one for now then