Automattic / Automattic/jetpack
[DataSync] No Mutation Shared State
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
When using the useMutation hook in a custom hook that is used in multiple components, the mutation status is not shared between those components: https://github.com/TanStack/query/issues/2304
I've addressed that for `useDatasyncAction` here: https://github.com/Automattic/jetpack/pull/35962
But this is still an active problem in `useDataSync`
However, @thingalon pointed out that this may not be an issue - depending on how we want to deal with this, and perhaps we should maintain feature parity with react-query here.
I think we're going to need a way to listen to shared mutations. So even if we do revert `useDataSyncAction` fix, we still need a more streamlined way to listen in on global mutations state.
Either way - the current situation is not great, because it's neither here nor there. Mutations right now are inconsistent in DataSync.
Contributor guide
Assessment
This issue has not been assessed yet.