-
Notifications
You must be signed in to change notification settings - Fork 25k
[Android] fix: network call timeout #38953
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
Conversation
Base commit: ae88aef |
|
I looked through to see what is piping timeout to native, and confirmed new behavior is the expectation for |
|
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| // client and set the timeout explicitly on the clone. This is cheap as everything else is | ||
| // shared under the hood. | ||
| // See https://github.com/square/okhttp/wiki/Recipes#per-call-configuration for more information | ||
| if (timeout != mClient.connectTimeoutMillis()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is no longer correct (should be callTimeoutMillis()). I can fix it up quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how change this line?
|
It looks like RN is internally built using |
|
Hey 👋 Moreover, https://square.github.io/okhttp/changelogs/changelog_3x/#version-3149 has 2 years and maybe we should consider migrating it to the newest one https://square.github.io/okhttp/changelogs/changelog_4x/#version-4100 ? |
|
This pull request was successfully merged by @troZee in e00f244. When will my fix make it into a release? | Upcoming Releases |
|
I changed the lines you mentioned and still not working! is working with you? @Marco29001 |
|
I tested this with a pre-release version and if the timeout issue mentioned in this PR works, but there is still an issue that I think is related to this issue, what happens is that if the connection is lost for a long time when I recover it, it happens to me. I can't make a new request until a certain amount of time passes, this only happens on Android |
|
@Marco29001 we need a solution please |
|
@Marco29001 @hasan642 could you provide a repro for that? |
Summary:
This PR is a continuation of this #29471. All context you can find here:
axios/axios#2073 (comment)
axios/axios#2073 (comment)
Changelog:
[ANDROID] [FIXED] - change
connectTimeouttocallTimeoutin OKHttp clientTest Plan:
Expected result
Request timed outshould be visible in a consoleVideos
Before
Before.mov
After
After.mov
Example URL
Branch:
https://github.com/troZee/react-native/tree/fix/network-timeout-example
Commit:
https://github.com/troZee/react-native/commit/e255e1a423143c4bd4f3e37656a56ba2ecbbf3e2