Transactions always rolling back? #464
-
I've used both |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Optimistic changes are always rolled back when the mutationFn returns. So before the mutationFn returns, you need to make sure the server change has been synced back into the collection. E.g. here it calls |
Beta Was this translation helpful? Give feedback.
Optimistic changes are always rolled back when the mutationFn returns. So before the mutationFn returns, you need to make sure the server change has been synced back into the collection. E.g. here it calls
await collection.utils.refetch()
https://tanstack.com/db/latest/docs/overview#explicit-transactions