Question about race conditions
As far as I have read from the documentation, Convex is entirely reactive and prevents race conditions. That's great! In this case, can we say for certain that there will be no race condition in the following scenarios?
Let's say a "like" function will be created, which will create a like document when liked and delete this document when unliked. In this case, the first option is to create a single toggleLike function and check if the document exists with each like and unlike operation, and the second option is to create two functions for like and unlike, and learn whether it is already liked or not based on a previously defined useQuery result before performing a useMutation, and then use the appropriate function accordingly.
Which of these two options guarantees that there will be no race condition, meaning that no extra like document will be accidentally created when multiple people like at the same time? (Assuming they all use the same account)
Thank you in advance for your time
