This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
You can continue the conversation there. Go to discussion →
teardown
operations are called immediately on the page reload even if a cache-and-network
call is pending
#3233
After the big work on #3200 there is an issue in how
teardown
operations are called on the page reload (when there are cached data).REPRODUCTION: https://codesandbox.io/p/sandbox/issue-urql-6-duplicated-requests-forked-0ybcue.
Steps:
click on "Todos list"
open the browser Dev Tools's console
reload the page
see in the console
before, else
followed immediately (and not after the fake delay of the backend)before, op.kind === teardown
What I expect
I expect
teardown
to be called after the backend fake delay response.More context
I'm using a custom exchange to track pending requests globally:
@kitten said that maybe the issue is my custom exchange and that
but the thing is the
after()
function of the custom exchange is NEVER called on the first load.I do not understand why the
teardown
operation is issued. If this is acache-and-network
call it should wait for the server answer, nope?Thanks for your work, it's not something I take for granted. Really, thanks.
Gif
The text was updated successfully, but these errors were encountered: