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: ssr logic shouldn't be used when rendering from the client #5839

Closed
wants to merge 3 commits into from

Conversation

mikebm
Copy link

@mikebm mikebm commented Jan 24, 2020

This PR addresses an issue where the SSR loading state could be returned on the client. The issue was introduced on this PR: https://github.com/apollographql/react-apollo/pull/3515/files

When temporarily using disableNetworkFetches on the client, it caused components to get stuck in a loading state coming from the SSR logic. This can be seen on network-only, and cache-and-network fetch policies when using a workaround as described here:
#4814

@mikebm mikebm requested a review from hwillson January 24, 2020 22:04
@@ -51,10 +52,11 @@ describe('useQuery Hook', () => {

describe('General use', () => {
it('should handle a simple query properly', async () => {
let resultData;
Copy link
Author

@mikebm mikebm Jan 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified this test to ensure it never gets stuck in a loading state since it never did an expect if loading = true.

@liang3404814
Copy link

Can confirm this is indeed an issue when using v3.1.2.

@Axxxx0n
Copy link

Axxxx0n commented Apr 7, 2020

@hwillson, the gentlest bump on this. Issue is also stopping us to use ssr: false with ssrForceFetchDelay.

@liang3404814
Copy link

Any update on this? I'd be willing to help out if needed :)

@alessbell
Copy link
Member

Hi @mikebm 👋 Sorry for the delay here! There have been considerable changes to the library since this PR was opened—src/react/data/QueryData.ts no longer exists, for one—and the linked issue has been closed, so I'm going to go ahead and close this PR. Please feel free to open a new issue and/or PR for any future issues you may encounter, thanks!

@alessbell alessbell closed this Feb 16, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants