Replies: 2 comments 2 replies
-
Is your backend fulfilling those requests ? (We're missing an interesting part of your screenshot with requests times) |
Beta Was this translation helpful? Give feedback.
1 reply
-
I've also tested this using @kentcdodds informative full stack components article (which is essentially a fully-realized version of this test case), and I'm getting similar results after adding an artificial delay. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've just started exploring Remix, so I fully understand that I may have got this wrong, but I expected that Remix would cancel all stale fetch requests when initiating a new one.
I've created a simple test case to show the issue:
https://stackblitz.com/edit/node-yp8gvx?file=app%2Froutes%2Findex.tsx,app%2Froutes%2Fchars.tsx
It uses
useFetcher
to make a call to resource route every time the text in the input box changes. I've added an artificial 4s delay to the loader on the resource route to clearly show what's happening.When I type "homer" in the search box, 5 search requests are sent, which makes sense:
I would expect that the first 4 fetches would be cancelled, since the following one would interrupt it (assuming all were typed within the 4s delay), however, it looks only some of the requests are cancelled:
If I type "this is a test", it looks like every other request is cancelled:
Am I missing something here?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions