-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add checking for existence of fetchMoreQuery
in store
#3367
Add checking for existence of fetchMoreQuery
in store
#3367
Conversation
fetchMoreQuery
in store
Generated by 🚫 dangerJS |
It does seem to point to a larger issue, but given that I have no way of even catching this error, it would be good to have this guard in place. It's by far the most frequent Apollo error we face in our app. |
Any update on this? This bug causes frequent crashes in React Native apps when infinite scroll is used on FlatList/SectionList and that FlatList/SectionList gets unmounted |
As far as I can tell this PR fixes the error and crash on react native, just needs some 👀 from a maintainer |
@helfer maybe some 👀 on this? It's just a 2 liner guard :) Happy to help push this forward where needed |
@rtymchyk I'll have this reviewed today. We should be able to get this in place for our next release (May 29th). |
Thank you very much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @conrad-vanl! I've added a few tests to verify things, and everything looks great. We should be all set to get this merged. Thanks again!
Fixes #3345
We are noticing that there are scenarios where
this.store[fetchMoreForQueryId]
is undefined, which throws an error and causes an RSOD in react-native. I am having issue reliably recreating this issue, thus I did not add test coverage for this yet - but happy to do so if we feel it's needed for this case.I believe the logic added in this PR results in safer code, but I'm not sure if the fact that
store
not containingfetchMoreForQueryId
points to another issue elsewhere. It seems logical to include the conditional check that's added in this PR, especially since we check forthis.store[queryId]
just a few lines above, but wanted to call that out.Checklist:
If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)If this was a change that affects the external API used in GitHunt-React, update GitHunt-React and post a link to the PR in the discussion.