Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] fetchTimeout does not handle network latency #200

Closed
edsrzf opened this issue Dec 4, 2023 · 2 comments
Closed

[Bug] fetchTimeout does not handle network latency #200

edsrzf opened this issue Dec 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@edsrzf
Copy link

edsrzf commented Dec 4, 2023

Current Behavior
If I specify fetchTimeout in the init method, the timeout only comes into effect when the request fails. If the request is simply slow, due to network latency, the timeout doesn't trigger.

Expected Behavior
The timeout should be triggered when the fetch request is slow.

Steps to Reproduce

  • Initialize Transifex Native using a fetchTimeout.
  • Simulate network latency through a proxy or other developer tools. The latency must be longer than the configured timeout.
  • Observe that translation-fetching continues past the timeout.

Possible Solution
Add a timeout to the axios.Get call.

Possible Implementation
I would use an Axios AbortController with a timeout based on fetchTimeout, as documented on this page: https://axios-http.com/docs/cancellation

@edsrzf edsrzf added the bug Something isn't working label Dec 4, 2023
@n1k0sv
Copy link

n1k0sv commented Jan 4, 2024

This is handled as part of this PR: #204

@n1k0sv
Copy link

n1k0sv commented Jan 26, 2024

Fix has been released on @transifex/[email protected]

@n1k0sv n1k0sv closed this as completed Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants