Skip to content

Conversation

@TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Dec 9, 2023

mutations were not gc'd correctly when being reset. GC was invoked on unsubscribe, but reset disconnects the observer from the mutation in the cache and must thus also trigger a GC, because the observer is no longer watching the values of that mutation, and another mutate() call will create a new mutation anyway. Thus, the old mutation becomes orphaned when reset is called.

mutations were not gc'd correctly when being reset. GC was invoked on unsubscribe, but reset disconnects the observer from the mutation in the cache and must thus also trigger a GC, because the observer is no longer watching the values of that mutation, and another mutate() call will create a new mutation anyway. Thus, the old mutation becomes orphaned when reset is called.
@vercel
Copy link

vercel bot commented Dec 9, 2023

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
query ⬜️ Ignored (Inspect) Dec 9, 2023 9:44am

@nx-cloud
Copy link

nx-cloud bot commented Dec 9, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 81038ac. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 9, 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 81038ac:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@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

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b54936f) 87.83% compared to head (81038ac) 88.39%.
Report is 10 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6509      +/-   ##
==========================================
+ Coverage   87.83%   88.39%   +0.56%     
==========================================
  Files          87       75      -12     
  Lines        2926     2585     -341     
  Branches      803      680     -123     
==========================================
- Hits         2570     2285     -285     
+ Misses        297      255      -42     
+ Partials       59       45      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TkDodo TkDodo merged commit e34bfab into main Dec 9, 2023
@TkDodo TkDodo deleted the feature/mutation-gc-leak branch December 9, 2023 09:48
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.

3 participants