This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I do not remember, have I created this issue or not, but
defaultAxios
doesn't have timeout at all.What problem it could generate? If battle.net endpoint somehow doesn't reply you back or packets will be missing, you will never receive the response at all.
For example, if I request data about 10 characters one-by-one, and on the 3rd character request I don't receive a reply from API, well it will block the main thread. Literally forever.
So this little string adds a timeout to axios instance, which will reject the request by timeout. I also understood that according to this issue the axios will be removed by the native
fetch
method, which doesn't support the timeouts at all. But by creating this pull request I just notify that the problem exists and it deserves any attention.Okay, to be honest, according to this issue thread in the
fetch
repo most of the devs think about the timeout option as userland, so in that case, it should be implemented manually.