Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 797 forks source link

[DataSync] No Mutation Shared State #35972

Open pyronaur opened 9 months ago

pyronaur commented 9 months ago

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.

github-actions[bot] commented 3 months ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.