-
Notifications
You must be signed in to change notification settings - Fork 69
Description
When bandwidthAbortRequestDuration is set and that time has passed, it gives an error even when the transfer has finished within the timeout.
The abortTimeout (https://github.com/cloudflare/speedtest/blob/main/src/engines/BandwidthEngine/BandwidthEngine.js#L278) is only canceled when the request is aborted.
It also needs canceling when the retries are reset to zero (this seems logical as the creation of the abortController depends on it being zero)
https://github.com/cloudflare/speedtest/blob/main/src/engines/BandwidthEngine/BandwidthEngine.js#L363
(or at some other point, i'm not super familiar with the codebase)
(don't stick it in the first then because that can still throw an error and lead to a retry)
Further i'm seeing: Uncaught TypeError: Cannot read properties of undefined (reading 'abort') in cancelCurrentMeasurement():
https://github.com/cloudflare/speedtest/blob/main/src/engines/BandwidthEngine/BandwidthEngine.js#L396
Not sure how exactly that happens, seems like a less important race condition.
Maybe just guard the abort() with a check if currentAbortController is not undefined?