-
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
Loading never gets updated to "false" #1186
Comments
I am experiencing this issue as well. The |
In our case the |
@tomitrescak does the loading flag never get updated to |
In my case: It gets set to |
Sorry for the confusion, yes the situation is the same, I call resetStore and it reloads data but never gets updated to |
@schickling, @tomitrescak what versions of Apollo client are you on? I’m trying to reproduce the error, but loading is getting correctly set to |
Out of curiosity does an error occur in GraphQL when your query is re-fetched? We’ve seen that cause some issues before. |
@calebmer I'm on 0.6.0. After I have upgraded to 0.7.3, it seems it works better. Let me test it further as I had problems on several spots. Can @schickling also report if upgrade helped? |
@schickling Could you try with #1202? I’ll see if I can reproduce this in a test. |
(here is the test by the way that models the correct behavior: https://github.com/apollostack/apollo-client/pull/1202/files#diff-3e9523eee379c5b7eca8da84dae6bbe5R3092) |
Ok, it is NOT updating for me as well. It's quite indeterministic ;( |
Hmm, ok, we’re going to need more context then. Is perhaps a query running when you call @tomitrescak and @schickling definitely try #1202 so we can see if that fixes it. |
@calebmer can you release a temporary version? Afaik |
We might be able to just do a patch release as all of the tests still pass. cc @helfer |
I tried to checkout master of this repository and react-apollo and npm link them into my project, but it seems react-apollo is not up to update with the latest changes in apollo-client. Instructions on how to properly try out #1202 would be appreciated. I tried to manually hack the changes from #1202 directly into the apollo client umd bundle inside node_modules. After this change the loading flag behaved correctly, but "data" was not set unless we set returnPartialData to true in the query options. |
Hi, just following up. This is still persistent in 0.10.0 after the brand new batchingnetworkinterface. Can I somehow help? I just don't know where to start and what to watch for. |
Can confirm. This is really a severe problem for us using Apollo Client. Is this somewhat on your roadmap for 1.0 @helfer? |
@schickling a temp solution for now (unless you are using streaming data) is to check for existence of data in the "data" property, and not the "loading" property. But yes, a systematic solution would be helpful. |
@tomitrescak This is what I am doing also. |
@tomitrescak @schickling I want to make sure this gets fixed, but it's a bit difficult without any reproduction. Even an indeterministic one would be better than nothing. Can one (or both) of you try creating a reproduction with https://github.com/apollographql/react-apollo-error-template? |
I'll try to come up with a minimal example over the weekend. Maybe @tomitrescak can provide one earlier? |
In my current project which is built in React Native on iOS. We link to business websites based on the users location. I have noticed that when I go to a business website from the app and Apollo polls for updates while the app in not in the foreground then return to my app is normally when the loading variable is not set to false even though I have all my data. This does not always happen but it is repeatable if I do it a few times. I will try to get a example project up this weekend also. I am also happy to share my current project if you think that would help. Thanks! "apollo-client": "^0.10.0", |
Hi ! I'm currently working on a project where I need to handle different languages.
When the freshly fetched data is different from the old one, there is no problem, my component re-render with the freshly fetched data.
what I expect |
@schickling did you manage to build a minimal reproduction for this? |
I tried notifyOnNetworkStatusChange: true again but it didn't help. @ShepelievD do you have a container component with multiple queries? |
Can confirm this is still reproducible on the |
@juank11memphis yes, I do |
@ShepelievD Would it be possible for you to share some code so we can figure out what are we doing wrong? |
I think I just hit that bug also. Code for TodosList:
Code for TodoListSub:
pakcage.json deps
|
Just hit this bug as well. My scenario is very similar to that of @cyrus-za and @oliviertassinari from apollographql/react-apollo#170. I managed to isolate the kinds of updates that result in loading being stuck to We are using react-apollo 1.4.16 and apollo-client 2.3.5. Our scenario: I isolated 3 conditions that are necessary for it to be stuck:
Like others have noted before me, the queries execute without errors, the data is in the cache, it is just that when the data is loaded my page is not updated by the |
+1 |
This is very annoying bug, it still happens( |
Still occurring for us as well. Hopefully we'll be able to make a reproduction.. |
I am having the same issue. It only happens when I perform a second query different from the first that yields the same result as the first. |
@austincondiff I noticed the same thing (see my comment above). |
In react-apollo 1.4.x the |
@chris-guidry I still experience the same issue in react-apollo 2.2.0 |
@andrewpeterprifer did you ever find a solution of workaround? |
@austincondiff notifyOnNetworkStatusChange: true worked for me as well. Given we have the same reproduction, I think it will work for you too. |
@andrewpeterprifer I can confirm that it did work! 🙌 Thanks a lot! |
This still occurs with the latest version when using composed As mentioned above, adding
|
I'll make a note here that the issue still persisted for me when using |
I've also encountered this bug on mutations, not just queries :/ |
Same behavior here.
We use apollo as HOC.
|
For those reading this thread, and using react-apollo: loading state is not
updated for all types of data fetches, and hence query components do not
re-render. The docs are here:
https://www.apollographql.com/docs/react/data/queries/#inspecting-loading-states
You can get fine-grained loading state from the networkStatus parameter.
…On Wed, 2 Oct 2019, 14:42 Jan Míšek, ***@***.***> wrote:
Same behavior here.
"apollo-cache-inmemory": "1.5.1",
"apollo-client": "2.5.1",
"apollo-link": "1.2.6",
"apollo-link-context": "1.0.12",
"apollo-link-error": "1.1.5",
"apollo-link-http": "1.5.9",
"react": "16.8.2",
"react-apollo": "2.3.3",
We use apollo as HOC.
fetchPolicy: 'no-cache', or notifyOnNetworkStatusChange: true, solved the
problem.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1186?email_source=notifications&email_token=AAUWLX4ODZNTKXDIB24DCIDQMQ7GFA5CNFSM4C4U5VUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEADXFXA#issuecomment-537359068>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUWLXYUAM4IERPZGGFLKDLQMQ7GFANCNFSM4C4U5VUA>
.
|
I can confirm that this bug still occurs on
In my case it was
|
I confrim this bug still occurs on In my case I add
|
Hi, this is very indeterministic behaviour. But sometimes the
loading
flag never get updated totruefalse. I can see that data are correctly received by client in the console. Any idea how can I debug this to report why is it not getting updated?[EDIT]: I can report that it only happens on queries that return arrays of fields
The text was updated successfully, but these errors were encountered: