Open PhoebeSzmucer opened 2 months ago
Hi there @PhoebeSzmucer 👋
Thanks for opening this issue! The reproduction is very clear, and this indeed looks like a bug. I've gone ahead and opened draft PR #12071 with a test that reproduces the issue. Our team is in the midst of conference season right now, but I hope to take a closer look soon. Thanks again!
Issue Description
Hi. I believe I found a bug in
ObservaleQuery.subscribe
. I'm attaching a CodeSandbox repro, but it's essentially this code:Essentially we receive a "loading" event with no data, and then nothing afterwards. This means that the consumer of this observable is stuck in a loading state.
This works correctly if the if the data actually changes after a reload, which means that it's likely because of an optimization that prevents calling
next
when nothing changed. I think the logic ofisDifferentFromLastResult
needs to be modified.When
notifyOnNetworkStatusChange
is false no event is fired, but that seems correct.Link to Reproduction
https://codesandbox.io/p/devbox/tender-framework-68wm4d?workspaceId=7e27fe59-1d44-40f8-b1d0-beb23c6580e8
Reproduction Steps
No response
@apollo/client
version3.11.8