-
Notifications
You must be signed in to change notification settings - Fork 132
Closed
Description
- I've validated the bug against the latest version of DB packages
When trying to run an optimistic action on an electric collection, I get this error.
Uncaught Error: Scheduler detected unresolved dependencies for context 1efbf3e1-41e3-4201-9f42-da1f38ec6ae9.
This only seems to happen when mutating the draft object.
To Reproduce
const someCollection = createCollection(
electricCollectionOptions({
...
})
)
const testAction = createOptimisticAction<string>({
onMutate: id => {
someCollection.update(id, draft => {
draft.name = 'new name here';
});
},
mutationFn: async (id, _params) => {
return { txid: 0 };
}
});
...
testAction("1efbf3e1-41e3-4201-9f42-da1f38ec6ae9")Disabling optimistic update prevents the error:
someCollection.update(id, { optimistic: false }, draft => {
draft.name = 'new name here';
});However this obviously defeats the point!
Metadata
Metadata
Assignees
Labels
No labels