Timeout timer invalidate in useFetch.
KyleXie opened this issue · comments
Summary (generated):
The speaker mentions a potential bug in the Nuxt framework. After a request is made, the timeout timer is not being cleared, which could cause it to trigger prematurely even if the request completes in time. Additionally, since the controller is a global variable, the timeout timer from a previous request could accidentally cancel the next request while it is still ongoing.
I'm not sure if it's a bug here. I see the timeout timer is not being cleared after the request, so it'll trigger even if the request gets a response in time. It could happen that the timeout timer of a previous request may trigger while the next request is ongoing if we call the refresh function of useFetch
, so it may accidentally cancel the next request.
nuxt/packages/nuxt/src/app/composables/fetch.ts
Lines 151 to 166 in 341fbe6