-
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
Watch queries are stuck in loading: true, partial: true
when notifyOnNetworkStatusChange
is enabled
#9845
Comments
At risk of this being unrelated (my apologies in advance if it isn't the same thing), I'd like to add that this also happens on
We have a case where we are using the For the time being, we've worked around it (in React) with: const [loading, setLoading] = useState(false)
function foo() {
setLoading(true)
fetchMore({...}).finally(() => setLoading(false))
} |
Hi all, I'm doing some housekeeping and found this issue. It appears this was resolved in #10105 so I'll close this. Thanks a bunch! |
Thank you for the update on the issue 🙌 |
@fmorenodesigns since the original issue added a test that is now successful, it seems that you have a different issue. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When
notifyOnNetworkStatusChange
is enabled some watchQueries get stuck inloading: true, partial: true
after callingreobserve
/setVariables
even if the underlying network request has already returned a successful result.In particular, this bug happens when a reobserved query returns the same data with the new variables as before, or when the query is simply refreshed.
Related to #9367
Proposed fix in #9844
Aside: notice also that apollo-client is returning
partial: true
even ifreturnPartialData
is disabled whennotifyOnNetworkStatusChange
is enabled.Intended outcome:
I would expect ObservableQuery to always report
loading: false
when a network request finishes. Also I would expect apollo client to neverloading: true
open forever.Actual outcome:
ObservableQuery supresses result with
loading: false
because data is the same asObservableQuery.last.result
. Butloading: true, partial: true, data: undefined
was not saved asObservableQuery.last.result
.How to reproduce the issue:
See test added in pull request #9844
Versions
apollo client 3.6.8
The text was updated successfully, but these errors were encountered: