Skip to content

Conversation

TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Jan 30, 2023

when resumePausedMutations is called multiple times, we are starting the second paused mutation even though the first one has not yet finished. This can happen when a focus event and an online event happen in short succession

closes #4896

when resumePausedMutations is called multiple times, we are starting the second paused mutation even though the first one has not yet finished. This can happen when a focus event and an online event happen in short succession
@vercel
Copy link

vercel bot commented Jan 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
query ⬜️ Ignored (Inspect) Feb 12, 2023 at 8:53AM (UTC)

@TkDodo
Copy link
Collaborator Author

TkDodo commented Jan 30, 2023

@jligeza I've reverted, and here is the same PR again in draft version. I won't get around to taking another look soon, but maybe you want to look into or know why this happened 🤔

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 30, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 66d3a2a:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration
damp-worker-l4g8n6 Issue #4896

mutation.continue() needs to immediately resolve back if we didn't really continue so that consecutive calls to resumePausedMutations can be appended to the promise chain
@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2023

Codecov Report

Base: 91.70% // Head: 91.85% // Increases project coverage by +0.15% 🎉

Coverage data is based on head (66d3a2a) compared to base (02852dd).
Patch coverage: 100.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4906      +/-   ##
==========================================
+ Coverage   91.70%   91.85%   +0.15%     
==========================================
  Files         111      111              
  Lines        4133     4138       +5     
  Branches     1064     1067       +3     
==========================================
+ Hits         3790     3801      +11     
+ Misses        322      316       -6     
  Partials       21       21              
Impacted Files Coverage Δ
packages/query-core/src/mutation.ts 93.87% <100.00%> (+5.75%) ⬆️
packages/query-core/src/mutationCache.ts 100.00% <100.00%> (ø)
packages/query-core/src/queryClient.ts 96.95% <100.00%> (ø)
packages/query-core/src/retryer.ts 98.98% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TkDodo
Copy link
Collaborator Author

TkDodo commented Jan 31, 2023

@jligeza can you please check one more time with this sandbox:

I've added some log statements and they always execute in serial now for me. For some reason, the submitted mutation doesn't show up on screen though? That's why I added the extra log statements in the mutationFn. Please confirm.

@TkDodo TkDodo marked this pull request as ready for review January 31, 2023 09:15
@jligeza
Copy link

jligeza commented Jan 31, 2023

Works for me.

@TkDodo TkDodo merged commit 1ef2958 into main Feb 12, 2023
@TkDodo TkDodo deleted the feature/dependent-mutations branch February 12, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

race condition in offline -> online state transition with dependent mutations
3 participants