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

Affordance for suppressing transient transport errors #270

Closed
timbotnik opened this issue Jun 6, 2016 · 3 comments
Closed

Affordance for suppressing transient transport errors #270

timbotnik opened this issue Jun 6, 2016 · 3 comments
Milestone

Comments

@timbotnik
Copy link
Contributor

When the network has occasional drop-outs, we might not care. It would be nice for Apollo client to be able to distinguish between transport and application errors so we could do some automatic retrying and error suppression. This is especially true of polling queries.

In the case of react-apollo, when we receive new props with an error, our data can disappear. The work-around is to do something like this:

shouldComponentUpdate(nextProps) {
    if (nextProps.data.errors) {
      return false;
    }
    return true;
},

But that seems like unnecessary boilerplate for something that is a transient network event.

@helfer helfer added the feature label Jun 7, 2016
@Poincare
Copy link
Contributor

Poincare commented Jun 9, 2016

I guess this means that Apollo Client should distinguish between network and application errors and react-apollo should distinguish between errors that require a component update and those that do not?

@helfer helfer added this to the New API/Refactor milestone Sep 29, 2016
@helfer helfer modified the milestones: Post 0.5, Release 0.5 Oct 26, 2016
@helfer
Copy link
Contributor

helfer commented Nov 17, 2016

I think the right thing to do here is:

  1. Handle partial results by calling observer.next instead of observer.error and write as much data to the store as we can. Thanks to error paths we can actually do this now.
  2. Don't call observer.error on network errors while polling. Instead just stay in the polling network status and keep trying.

This approach will work well if we assume that people don't want to be notified when a polling query encounters a network error. If they do want to be notified, we'll need to have an extra argument to polling queries.

@helfer
Copy link
Contributor

helfer commented May 3, 2017

I think this is still a great idea, but the issue is quite old already. Let's continue discussion in #1210.

@helfer helfer closed this as completed May 3, 2017
jbaxleyiii pushed a commit that referenced this issue Oct 18, 2017
Add link to FuseBox plugin
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants