AbortHandler's timeout should always be cleared#474
AbortHandler's timeout should always be cleared#474Rapha0511 merged 1 commit intodailymotion:masterfrom
Conversation
the timeout should always be cleared even if an error occurred within the promise
Rapha0511
left a comment
There was a problem hiding this comment.
Hello!
Thank you for reporting this issue!
I left some comment.
| .finally(()=>{ | ||
| clearTimeout(timer); |
There was a problem hiding this comment.
Can this be done in a finally block after the catch ? since .finally() is usually used in a Promise chain
There was a problem hiding this comment.
the await isn't that different that a promise chain, only different syntax. if you would want to move it to the try..catch..finally. the const timer needs to be moved outside the try block since it's block scoped. probably all together less neat.
|
any update on this? i hoped it would have been included in 6.0.1 |
|
Hello @olafbuitelaar |
|
when is it planned to publish this? |
It's ready to use! 🎉 Available in |
the timeout should always be cleared even if an error occurred within the promise
Description
When you provide a custom urlHandler and an error occurs here-in it could be possible the abortHandlers timeout isn't cleared, causing the abortHandler to trigger even if the request is done.
Type