optimistic updates but multiple documents at once
I'm creating a new chat thread + assocaited user message + the assitant reply. We are creating a new thread + user + assistant message.
The thread is opimisitcally perfectly fine. But the useQuery for the message.list doens't have the information immediately.
I am wondering if Convex's sync engine is smart enough to automatically remap the optimstic Id's created. I'm struggling to get this implemntation right (new to convex), and particular whether convex is smart enough to remap the optimisticThreadId setter as seen below.
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!
okay figured it out.
solution: dont query message.list with real convex thread id but using our pre-generated client-id.
note, we use pre-generated client-id to achieve instant routing.