createTodo, which:todosCollection.insert.onInsert funtion returns { refetch: false }, which means the optimistic update is immediately rolled back and the UI will not show the new state.api.createTodo is called and the todo is created on the serverwriteDelete is called and errors out since the item with id: tempId was never added to the store.onInsert you call todosCollection.utils.writeInsert(transaction.mutations[0].changes) with the tempId, it will succeed, but then if there is an error actually saving it to the server then the change will never be rolled back unless you also add a writeDelete(tempId) in the catch.https://x.com/tan_stack/status/2031128535470104577?s=20
dry-scarlet · 6d ago
https://x.com/powersync_/status/2010721010006552775?s=20
dry-scarlet · 3mo ago
You can now submit your website/app/project to http://TanStack.com 's new showcase and have it seen by the TanStack community! - Global showcase browser - Per-library filters - Category filters Submit here: https://tanstack.com/showcase/submit View all here: https://tanstack.com/showcase
dry-scarlet · 3mo ago