StarlordS
Convex Community14mo ago
21 replies
Starlord

mutation doesnt rollback query state on failure

The issue is that as soon as the applyOptimisticUpdate function is called to modify the localstore, the remoteQuerySet map within the RemoteQuerySet class is immediately updated to match the localstore values—this happens before the mutation is executed.

In the first screenshot, you can see that the backend still holds the unmodified value. In the second screenshot, however, the remoteQuerySet already reflects the updated value, even though the mutation hasn’t been executed yet.

Mutation would throw an exception on the backend and values are not rollbacked.

I did not find the reason why remoteQuerySet is set to localstore values before mutation is even executed.
image.png
image.png
Was this page helpful?