Open louisscruz opened 5 years ago
I did some debugging of the useDeepMemo
in @apollo/react-hooks
and happened to sidestep the problem by swapping out:
import { equal } from '@wry/equality';
with
function equal(a, b) {
return a === b;
}
I doubt this is a valid solution, but maybe it gives some insight into what could be going wrong.
This issue has reproduction...
This issue still occurs with react-apollo 3.1
Thanks @ducarroz - yes, we haven't had a chance to get to this one yet. We will (🤞) very soon.
Same problem here !
thank you @louisscruz for explaining it so clearly.
Temporarily patching it by sending an incremental value along with every server error response to avoid having deep identical responses
Hello,
Any news about this?
We are also experiencing this problem and had to downgrade to 3.0.1 where the problem does not occur.
EDIT: Seems to be solved in 3.1.2?
@vieira Maybe you're experiencing a different issue than this one then? I experience this issue on all 3.x.x versions.
3.0.1: https://codesandbox.io/s/busy-perlman-8buyh 3.1.0: https://codesandbox.io/s/summer-glade-1c0x1 3.1.1: https://codesandbox.io/s/modest-moon-78vhu 3.1.2: https://codesandbox.io/s/charming-frog-t0xib
This is a pretty big blocker for us, any updates?
@birge Right now the Apollo team is hard at work preparing for the graphql summit next week. Hopefully they'll get back to issues after it's over.
I confirm the issue.
➜ ✗ yarn list @apollo/react-hooks ~/porn/dinotechltd/dino-bo
yarn list v1.19.1
warning Filtering by arguments is deprecated. Please use the pattern option instead.
└─ @apollo/react-hooks@3.1.3
any updates on this?
UPD if I set fetchPolicy
to network-only
it works
Any update on this?
new year new status?
I really want to have this issue fixed, but @louisscruz @birge https://twitter.com/slicknet/status/782274190451671040
@benjamn @hwillson could you please shed some light? are you guys expecting a PR for this? Do you have it in backlog maybe?
If this is still an issue, I would recommend trying to reproduce it in the latest @apollo/client v3 beta. If the issue still exists in the v3 beta, then maybe create a new issue in the apollo-client repo with the reproduction.
Blocker for me
@hwillson any chance to take a close look at this issue? we have codesandbox to reproduce it as well a test for it. Thanks.
It looks like we just need some guidance on how to solve https://github.com/apollographql/apollo-client/pull/6059. The last section of the PR description makes three proposals for solving this problem. Can someone take a look?
@dylanwulf yes I can confirm it is reproducible in @apollo/client
v3 beta https://codesandbox.io/s/client-3-hook-0r52i, created an issue in apollo-client repo https://github.com/apollographql/apollo-client/issues/6106
I think we can close this now, thanks to @benjamn this issue is fixed and released to 3.0.0-beta.43
https://github.com/apollographql/apollo-client/commit/7c9afe085371e624dcb3e6eb0c888965c982746e 🎉
Intended outcome:
When the variables to a given
Query
change, the query should be re-run with the new variables, and when the response is received, it should trigger a re-render of theQuery
component with the newdata
(and not remain in aloading
state).Actual outcome:
When the variables of a given
Query
change, and the received response happens to be exactly the same (at least in terms of a deep equality check), theQuery
component is stuck in aloading
state.How to reproduce the issue:
The issue we're seeing seems to happen specifically when two network response values are deeply equivalent. Additionally, it seems to only be an issue when the query is simultaneously going from
skip={false}
toskip={true}
.Here is an example: https://codesandbox.io/s/busy-perlman-8buyh
Version