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 (and force fetch in general) while the client is disconnected empties the store after erroring #334

Closed
rricard opened this issue Jun 29, 2016 · 9 comments
Assignees
Labels

Comments

@rricard
Copy link
Contributor

rricard commented Jun 29, 2016

Expected

If the polling fails because of a connection issue, still show errors in the console and everything, but don't change the contents of the store!

Obtained

If the polling fails because of a connection issue, errors arise in the console and empties the store where the query is.

Is this really the behavior we want ?

Fix proposition

Polling shouldn't just trigger a forceFetch but a forceFetch able to, when an error arises, don't change the apollo store state.

@stubailo
Copy link
Contributor

Good point! Will look into this. Error handling in general is something we are taking a look at soon.

@rricard
Copy link
Contributor Author

rricard commented Jun 29, 2016

Yes, then, in this case, I would be for, by default, not delete the contents of the store. (I thought the behavior was wanted if graphql errors arised)

@rricard
Copy link
Contributor Author

rricard commented Jun 29, 2016

I can look into that if you want as well, I will need a fix pretty ASAP and I see you guys already have a bunch of projects going on! 😉

@stubailo
Copy link
Contributor

We were going to take a look at error handling late this week or early next week, but I'd be happy to look at a design for a fix, or a PR!

@rricard
Copy link
Contributor Author

rricard commented Jun 30, 2016

Let me just finish first with #335, I'll see after that!

@Poincare Poincare self-assigned this Jul 6, 2016
Poincare added a commit that referenced this issue Jul 7, 2016
@Poincare
Copy link
Contributor

Poincare commented Jul 7, 2016

I attempted to reproduce this issue within a unit test in #368 but wasn't able to do it. Maybe I'm misunderstanding the problem or the problem is somewhere else, but it seems that the store is not emptied if we have a polling query that faces a network/connection error of some kind.

Could you provide some insight as to what setup leads to this issue @rricard ?

@rricard
Copy link
Contributor Author

rricard commented Jul 7, 2016

I need to retake a look. Maybe a recent change may have fixed that.

@rricard
Copy link
Contributor Author

rricard commented Jul 8, 2016

@Poincare: my bad the issue is on apollostack/react-apollo: when an error is associated to the component, the component doesn't receive the data anymore.

@rricard
Copy link
Contributor Author

rricard commented Jul 8, 2016

@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
Projects
None yet
Development

No branches or pull requests

3 participants