Ali Madooei
CCConvex Community
•Created by Ali Madooei on 12/22/2024 in #support-community
Paginated Queries correctly when multiple concurrent mutations
Thanks Lee! Yes, the problem was somewhere else in my code and it is resolved now (irrelevant to this discussion). So, I can confirm for anyone reading this thread, the with paginate query was due to using
Date.now()
14 replies
CCConvex Community
•Created by Ali Madooei on 12/22/2024 in #support-community
Paginated Queries correctly when multiple concurrent mutations
@lee if you have any thoughts on why updating any of the messages does not update the React state, please let me know. I'll try to figure it out too, and if I find the problem, will report here for reference for others. Thanks again.
PS. by update does not work I mean, let's say I have a list of messages. If I even directly update a message in the database, I don't see the update in the app. The "reactivity" which was creating the realtime feature is lost! And I'm not sure if the problem is the paginated query or something else.
14 replies
CCConvex Community
•Created by Ali Madooei on 12/22/2024 in #support-community
Paginated Queries correctly when multiple concurrent mutations
Going back to chaining the queries, I thought I can use
Number.MAX_SAFE_INTEGER
instead of Date.now()
and it seems to work:
14 replies
CCConvex Community
•Created by Ali Madooei on 12/22/2024 in #support-community
Paginated Queries correctly when multiple concurrent mutations
Thanks, Lee! This partially fixed my problem. I don't have InvalidCursor anymore but updates to messages (e.g., updating the AI placeholder message as the AI response streams) does not work; looks like the React state does not change. I don't know why but I'm going to try to figure it out.
For anyone looking at this thread, I thought I should provide the following information. This assignment doesn't work:
q = q.lt("_creationTime", beforeThisCreationTime);
. So I ended up doing this:
I think the IndexRangeBuilder
works by updating the type parameter FieldNum
so to enforce that we proceed through the fields in index order. I don't know if there is a more elegant way of doing this (excpet going back to chaining).14 replies
CCConvex Community
•Created by Ali Madooei on 12/22/2024 in #support-community
Paginated Queries correctly when multiple concurrent mutations
I'm using this custom hook on the frontend:
14 replies
CCConvex Community
•Created by Ali Madooei on 12/22/2024 in #support-community
Paginated Queries correctly when multiple concurrent mutations
This is the actual query that calls the above helper:
14 replies
CCConvex Community
•Created by Ali Madooei on 12/22/2024 in #support-community
Paginated Queries correctly when multiple concurrent mutations
Sure! This is the helper function that my query calls:
14 replies
CCConvex Community
•Created by Ali Madooei on 12/2/2024 in #support-community
Internal queries/mutations/actions vs helper functions
Thanks Lee and sshader. This was very helpful - I appreciate it.
5 replies