Skip to content

Rehydrated mutations are being run multiple times, once in each tab #6733

Closed Answered by TkDodo
PabloRomanH asked this question in Q&A

You must be logged in to vote

tabs don't know anything about each other. if you open the same app in two tabs, they will both read the data from storage, so they will both see a paused mutation that they should retry. Now maybe the broadcastQueryClient plugin would inform other tabs that one mutation has already been triggered, but since the replay happens at the same time, this would likely already have been too late.

I think it's just technically really hard to:

  • store state in the same storage
  • read it from different tabs at the same time
  • still treat them as a shared resource where we'd need a semaphore / lock.

basically you're saying persisted mutation should only ever be read out from storage once? I guess you c…

Replies: 1 comment 8 replies

You must be logged in to vote
8 replies
@PabloRomanH

@TkDodo

@PabloRomanH

@TkDodo

Answer selected by PabloRomanH
@PabloRomanH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants