Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add failing test for #11649 #11651

Closed
wants to merge 2 commits into from
Closed

Conversation

jerelmiller
Copy link
Member

@jerelmiller jerelmiller commented Mar 8, 2024

#11438 made some changes to remove the retain call from useBackgroundQuery. This was due to allow the query to be disposed of naturally if it was not used by useReadQuery within a given amount of time.

This however introduced a new side effect, which is that the query ref stays "active" when useBackgroundQuery is unmounted before autoDisposeTimeoutMs timeout kicks in. This PR adds a failing test to demonstrate the issue.

This is also problematic when changing variables in useBackgroundQuery before the queryRef is consumed by useReadQuery. The old queryRef will stay active until the autoDisposeTimeoutMs kicks in, in which case it will then be properly disposed. This is also demonstrated in a failing test.

Copy link

changeset-bot bot commented Mar 8, 2024

⚠️ No Changeset found

Latest commit: d49341d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Mar 8, 2024

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 38.31 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 46.14 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 43.7 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 33.93 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 31.85 KB (0%)
import { ApolloProvider } from "dist/react/index.js" 1.23 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.21 KB (0%)
import { useQuery } from "dist/react/index.js" 5.26 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.35 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.5 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.58 KB (0%)
import { useMutation } from "dist/react/index.js" 3.51 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.73 KB (0%)
import { useSubscription } from "dist/react/index.js" 3.19 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 2.38 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.37 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.03 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 4.83 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.49 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 4.98 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.63 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.12 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 3.06 KB (0%)
import { useFragment } from "dist/react/index.js" 2.25 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.2 KB (0%)

Copy link

netlify bot commented Mar 8, 2024

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit fd4c002
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/65eb45fedf282700083703cf
😎 Deploy Preview https://deploy-preview-11651--apollo-client-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 8, 2024

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit d49341d
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/65eb4770a606f7000853bff4
😎 Deploy Preview https://deploy-preview-11651--apollo-client-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jerelmiller
Copy link
Member Author

Superceded by #11696

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant