Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: internetReachability aborts handle cancel correctly (#700)
InternetReachability aborts pending request by calling abort() of AbortController. According to AbortController API when abort() is called, the fetch() promise rejects with an Error of type DOMException, with name AbortError. So reject('canceled') will be ignored and checking error !== 'canceled' is useless. The right way is to use abort('canceled') to set reject reason to 'canceled' instead of DOMException. Previously because of that InternetReachability aborts previous request and calls _setIsInternetReachable(false).
- Loading branch information