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

Polling when server is down clears out results #1210

Closed
SachaG opened this issue Jan 21, 2017 · 7 comments
Closed

Polling when server is down clears out results #1210

SachaG opened this issue Jan 21, 2017 · 7 comments
Labels
📚 good-first-issue Issues that are suitable for first-time contributors. 🐞 bug

Comments

@SachaG
Copy link

SachaG commented Jan 21, 2017

With polling enabled, I've noticed that if I shut down my dev server the next time polling triggers (and errors out), my query container doesn't return any results and all my data disappears. Is this the intended behavior? I'd have thought the old data would remain there?

@helfer
Copy link
Contributor

helfer commented Jan 22, 2017

@SachaG Thanks for pointing it out! That's probably never what the user wants, so we should change it. Luckily this shouldn't be hard to fix, all we need to do is ignore the result of a polling query if there is an error.

@calebmer calebmer added the 📚 good-first-issue Issues that are suitable for first-time contributors. label Jan 23, 2017
@nandito
Copy link
Contributor

nandito commented Jan 27, 2017

@SachaG could you be a bit more specific? I tried to reproduce the issue but it works for me. When I stopped the GraphQL server, I got the OPTIONS http://example.com/graphql net::ERR_CONNECTION_REFUSED console error but my sample app kept the previously fetched data in the store.

@SachaG
Copy link
Author

SachaG commented Feb 4, 2017

It might be an issue with my app then… I'll close this until I can confirm this or give you more information.

@SachaG SachaG closed this as completed Feb 4, 2017
@SachaG SachaG reopened this Feb 23, 2017
@SachaG
Copy link
Author

SachaG commented Feb 23, 2017

I had more time to look into this. I tried triggering an error on the server, and got this response:

https://d3vv6lp55qjaqc.cloudfront.net/items/3r2a3a3d1Q0N0F3j220l/Screen%20Shot%202017-02-23%20at%2012.09.55.png?X-CloudApp-Visitor-Id=cebf9777be46527f7e0ca9fdd95dd995&v=3ff704aa

But weirdly enough, the status code still shows 200:

https://d3vv6lp55qjaqc.cloudfront.net/items/2o2k2E1i121h1V1C1E3m/Screen%20Shot%202017-02-23%20at%2012.09.30.png?X-CloudApp-Visitor-Id=d40749865873d7b5ab32c80852150f74&v=3bf1797c

Could that be why the container stops returning data?

@calebmer
Copy link
Contributor

Would it be possible for you to reproduce this error with react-apollo-error-template? It would go a long way in helping us solve this issue because we could see exactly what’s happening 😊

@SachaG
Copy link
Author

SachaG commented Feb 24, 2017

Sure, I'll see what I can do.

@helfer
Copy link
Contributor

helfer commented May 6, 2017

It should no longer clear out results in react-apollo with apollographql/react-apollo#548. For other integrations I think they should do a similar thing.

@helfer helfer closed this as completed May 6, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📚 good-first-issue Issues that are suitable for first-time contributors. 🐞 bug
Projects
None yet
Development

No branches or pull requests

4 participants