-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
use okhttp callTimeout to set request timeout #23038
Conversation
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.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Looks good! |
Uh oh, I think we may not be on that version of okhttp at Facebook which makes this pretty hard to land. |
@hramos would you please update okhttp at FB and merge this PR. IIRC, okhttp have no breaking changes. |
@dulmandakh Unfortunately it's not that simple. It seems like we won't be able to upgrade everything depending on RN to okhttp 3.12 anytime soon (possibly months). Is there any way we could work around this? |
Nope, it depends on okhttp 3.12. Let's wait until okhttp 3.12 lands in FB.
|
I asked around and there currently aren't any plans to upgrade okhttp internally. It seems that it would be a bit of work to update it for all apps. Previously it wasn't a big deal if FB apps use a different version of okhttp than RN in open source but it does matter when RN makes use of newer APIs. I'm going to close this PR as it isn't actionable. We should revisit this whenever we update okhttp at FB. |
how I can find out if okhttp at FB updated? |
Ask me again in a few months, I'm happy to let you know :) |
Summary: This sync includes the following changes: - **[51947a14b](facebook/react@51947a14b )**: Refactored how React/DevTools log Timeline performance data ([#23102](facebook/react#23102)) //<Brian Vaughn>// - **[c09596cc6](facebook/react@c09596cc6 )**: Add RN_FB bundles for react-is ([#23101](facebook/react#23101)) //<Moti Zilberman>// - **[9a7e6bf0d](facebook/react@9a7e6bf0d )**: Add --no-show-signature to "git show" commands ([#23038](facebook/react#23038)) //<Stefan Sundin>// - **[2f26eb85d](facebook/react@2f26eb85d )**: Add exports field to react-refresh's package.json ([#23087](facebook/react#23087)) //<Gray Zhang>// - **[811634762](facebook/react@811634762 )**: add enableTransitionTracing feature flag ([#23079](facebook/react#23079)) //<Luna Ruan>// Changelog: [General][Changed] - React Native sync for revisions fe905f1...51947a1 jest_e2e[run_all_tests] Reviewed By: rickhanlonii, kacieb Differential Revision: D33634332 fbshipit-source-id: a83b663a122a2cb79225ca33a007fe1774728c03
OkHTTP 3.12 introduced callTimeout or full-operation timeouts. And here is the snippet from changelog (https://github.com/square/okhttp/blob/master/CHANGELOG.md)
Previously we set timeout for connect, but not for full-operation. Therefore, network client connect to a server within timeout, but it may take forever to read responses or write requests. This PR fixes it.
Changelog:
[Android] [Changed] - Network request timeout works as expected using callTimeout
Test Plan:
CI is green, and everything works as before. But network timeout will for full-operation or as expected by many developers.