Chad MaycumberC
Convex Community3y ago
16 replies
Chad Maycumber

Help with an edge case

I currently have an action which calls other mutations. In this scenario; we're trying to create an AI chat. I'm running into a scenario where the users message is created inside of the chat action before the AI's chat message.

On the first chat the frontend doesn't update until the action fully completes leading the frontend to update with the user message, and AI chat at the same time.

After the first message subsequent chats work as expected where the users message is created, updated on the frontend and then the AI chat message is updated and streamed in.

Any help with understanding what I might be doing wrong would be great!
Was this page helpful?