[Android] fix: network call timeout#38953
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. |
| @@ -349,7 +349,7 @@ public void onProgress( | |||
| // 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.
This line is no longer correct (should be callTimeoutMillis()). I can fix it up quickly.
|
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