I think there are a variety of issues around about this, the clearest being https://github.com/apollostack/react-apollo/issues/347 (also https://github.com/apollostack/react-apollo/issues/303, https://github.com/apollostack/apollo-client/issues/884, and more)
If you throw an exception in a next() function in a query subscriber, it throws all the way to here (logging on the way). Note that an bug in a React render function will throw such an error.
This leads to an ApolloError being dispatched.
If the same error path runs in that error handling (which is very possible with RA), you get an infinite loop (see https://github.com/apollostack/apollo-client/issues/884).
I think we should separate the error handling for GraphQL problems from dispatch problems, via maybe adding an extra promise or an explicit try catch around the dispatch.
@helfer let me know if putting a repro together would help here.
Oh, interesting. Thanks for the writeup @tmeasday! I thought we fixed this in #910. Looks like there was another try-catch block higher up that we missed. 馃槵 This is a really annoying bug, so let's make sure we fix it for good this time.
After talking to @tmeasday and taking another look, here's what I think we should do:
Step 1: Intercept errors thrown from observer.next and observer.error and print them to the console.
Step 2: Introduce separate actions for network errors and store errors (right now everything is called a network error)
@helfer I don't think you covered step 2 in the PR?
@stubailo Yes that's right, I didn't cover step 2, because we'll need a major version bump to make that change. I think the PR took care of the issue here, and step 2 should be taken care of for 0.6 or possibly even a later version.
Most helpful comment
Oh, interesting. Thanks for the writeup @tmeasday! I thought we fixed this in #910. Looks like there was another try-catch block higher up that we missed. 馃槵 This is a really annoying bug, so let's make sure we fix it for good this time.