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

Fix Suspense boundary indefinitely shown when fetchMore returns error #12110

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jerelmiller
Copy link
Member

Fixes #12103

Fixes an issue where the Suspsense boundary would be shown indefinitely when fetchMore returned from useSuspenseQuery is called and an error is returned.

When using fetchMore, the handleNext function inside InternalQueryReference was never called so there was no handler to resolve the promise thrown to the Suspense boundary. This small fix ensures that reject is called in .catch so that the promise does not get stuck in pending.

@svc-apollo-docs
Copy link

svc-apollo-docs commented Nov 4, 2024

❌ Docs Preview Failed

Error

Error: ENOSPC: no space left on device, mkdir '/tmp/librarian/remote-sources/apollographql/apollo-client/jerel/fix-usq-fetchmore-error'

Copy link

changeset-bot bot commented Nov 4, 2024

🦋 Changeset detected

Latest commit: cc454a8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo/client Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

pkg-pr-new bot commented Nov 4, 2024

npm i https://pkg.pr.new/@apollo/client@12110

commit: cc454a8

Copy link
Contributor

github-actions bot commented Nov 4, 2024

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 39.32 KB (+0.04% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 48 KB (+0.03% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 45.58 KB (+0.04% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 34.4 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 32.29 KB (0%)
import { ApolloProvider } from "dist/react/index.js" 1.26 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.24 KB (0%)
import { useQuery } from "dist/react/index.js" 5.21 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.29 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.69 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.77 KB (0%)
import { useMutation } from "dist/react/index.js" 3.62 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.84 KB (0%)
import { useSubscription } from "dist/react/index.js" 4.42 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 3.48 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.51 KB (+0.33% 🔺)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.17 KB (+0.36% 🔺)
import { useBackgroundQuery } from "dist/react/index.js" 5.01 KB (+0.34% 🔺)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.66 KB (+0.46% 🔺)
import { useLoadableQuery } from "dist/react/index.js" 5.09 KB (+0.35% 🔺)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.73 KB (+0.43% 🔺)
import { useReadQuery } from "dist/react/index.js" 3.41 KB (+0.58% 🔺)
import { useReadQuery } from "dist/react/index.js" (production) 3.35 KB (+0.62% 🔺)
import { useFragment } from "dist/react/index.js" 2.28 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.23 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promise thrown by useSuspenseQuery gets stuck "pending" forever when fetchMore request fails
2 participants