[Optimistic Updates] ArgumentValidationError: Value does not match validator.
I get with my implementation of the optimistic updates this error:
Code (I quadruple-checked it, and it has no type errors):
5 Replies
Do you at some point call a mutation where the arguments come from something loaded by
useQuery(api.chats.getChats)
?The chatId comes as a URL param
But the userInfo comes from the Convex query:
Any other unclear arguments?
Optimistic updates are likely irrelevant. The error message says that youβre calling the markMessageRead mutation with messageId argument which is an ID from a different table than the required βmessagesβ.
Ohhhh, I think I got it. I ran the markMessageRead mutation with a optimistic message.
I think I have to check if the message is optimistic and then skip this mutation
I'd disable further actions on optimistic results (like disable the "mark as read" button).