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

[Android] Update OkHttp to 3.4.1 and Okio to 1.9.0 #8672

Closed
wants to merge 1 commit into from
Closed

[Android] Update OkHttp to 3.4.1 and Okio to 1.9.0 #8672

wants to merge 1 commit into from

Conversation

AndrewJack
Copy link
Contributor

@AndrewJack AndrewJack commented Jul 9, 2016

Motivation

  • 3.3.1 wasn't compatible with Robolectric 3.0, however 3.4.0 fixes this issue.
  • Few other fixes to OkHttp mentioned in the CHANGELOG.md

Motivation from #7746

Fixes: #7743

  • Android apps can recover from a REFUSED_STREAM in HTTP/2.
  • A few other fixes mentioned in the CHANGELOG.md

Test plan

  • CircleCi
  • Test with /Examples

@ghost
Copy link

ghost commented Jul 9, 2016

By analyzing the blame information on this pull request, we identified @cjhopman and @mkonicek to be potential reviewers.

@ghost ghost added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jul 9, 2016
@AndrewJack AndrewJack changed the title Update OkHttp to 3.4.0 and Okio to 1.9.0 [Android] Update OkHttp to 3.4.0 and Okio to 1.9.0 Jul 9, 2016
@AndrewJack
Copy link
Contributor Author

AndrewJack commented Jul 9, 2016

cc @mkonicek & @bestander

Upgrading to 3.4.0 fixes the issue we had with 3.3.1

@ide
Copy link
Contributor

ide commented Jul 10, 2016

This is really awesome and great to see the tests are passing. @bestander can you help land this in case the shipit bot isn't enough?

@ide
Copy link
Contributor

ide commented Jul 10, 2016

@facebook-github-bot shipit

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Jul 10, 2016
@ghost
Copy link

ghost commented Jul 10, 2016

Something went wrong when importing this pull request. Please cc someone from the team at fb to help with importing this.

@ghost ghost added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Jul 10, 2016
@bestander
Copy link
Contributor

Great work, Andrew.
I'll need to update internal okhttp as well.

@bestander
Copy link
Contributor

@facebook-github-bot import

@ghost
Copy link

ghost commented Jul 10, 2016

Thanks for importing. If you are an FB employee go to Phabricator to review.

@AndrewJack
Copy link
Contributor Author

AndrewJack commented Jul 10, 2016

https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-341

Will need to update OkHttp to 3.4.1 due to a major bug in 3.4.0

@AndrewJack
Copy link
Contributor Author

Created PR for 3.4.1 #8680 (includes fix for OkHttp encoding HTTP headers bug).

I'll update #8680 once this has been imported.

@bestander
Copy link
Contributor

@AndrewJack, what is the point of importing 3.4.0 if we can do 3.4.1?

@bestander
Copy link
Contributor

I mean it is easier to do in one go then multiple times.
Also what do you think, should we wait a week to see if there are any more critical issues found in 3.4.1?

@AndrewJack
Copy link
Contributor Author

AndrewJack commented Jul 11, 2016

@bestander lets just do #8680, I thought you had already imported this one.

@AndrewJack
Copy link
Contributor Author

AndrewJack commented Jul 11, 2016

@bestander We already have a few issues with the version we are currently using (3.2.0).

I think it is worth updating now, but I'll let you decide.

@bestander
Copy link
Contributor

I just wrote import command, some manual work to update internal app will be required, so feel free to bump this PR to the needed version please :)

@AndrewJack AndrewJack changed the title [Android] Update OkHttp to 3.4.0 and Okio to 1.9.0 [Android] Update OkHttp to 3.4.1 and Okio to 1.9.0 Jul 11, 2016
@AndrewJack
Copy link
Contributor Author

@bestander that's done and I've closed #8680

@bestander
Copy link
Contributor

@facebook-github-bot import

@ghost
Copy link

ghost commented Jul 11, 2016

Thanks for importing. If you are an FB employee go to Phabricator to review.

@bestander
Copy link
Contributor

It'll take a couple of days to allow people to review things and see if anything gets raised in okhttp repo

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 12, 2016
@bestander
Copy link
Contributor

Hey @AndrewJack, I stumbled upon internal tests failing because of square/okhttp#2533.
We have quite a few robolectric tests internally that fail because of isCleartextTrafficPermitted assert.

@bestander
Copy link
Contributor

I wonder what we should do about it.
Patching tests mocks is possible but I am not sure how the isCleartextTrafficPermitted changes will affect our production apps.
Also I don't want us to diverge okhttp versions between OSS and what FB uses internally because eventually it will result in the code that does not compile in one of the systems.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 19, 2016
@bestander
Copy link
Contributor

Any ideas?

This problem of difference between monorepo of dependencies at FB VS package managers in OSS projects is raised quite often.

Maybe OSS community could provide a layer of abstraction that allows native dependencies to be overridden?

@AndrewJack
Copy link
Contributor Author

AndrewJack commented Jul 19, 2016

In this case an app could actually force the upgrade with Gradle, by excluding okhttp and okio from react native dependency and adding on okhttp 3.4.1 and okio 1.9.0 as a project dependency.

For example:

dependencies {
    compile('com.facebook.react:react-native:+') {
        exclude group: 'com.squareup.okhttp3'
        exclude group: 'com.squareup.okio'
    }
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
    compile 'com.squareup.okhttp3:okhttp-ws:3.4.1'
    compile 'com.squareup.okio:okio:1.9.0'
}

This does seem to be a recurring issue.
OkHttp is very embedded into the react native implementation, so any abstraction would not be a simple task.

@AndrewJack
Copy link
Contributor Author

AndrewJack commented Jul 19, 2016

@bestander square/okhttp#2533 (comment) might fix your issue, if this what you want to do.

Robolectric 3.1 fixed the issue with OkHttp, but also broke compatibility with power mock.
robolectric/robolectric#2429

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 19, 2016
@bestander
Copy link
Contributor

I would not want to add some custom mocks until the issue is resolved by okhttp people.
Let's wait till it gets resolved

@AndrewJack
Copy link
Contributor Author

AndrewJack commented Jul 19, 2016

@bestander ok well in the meantime people can add the latest okhttp dependency to their app dependencies as a workaround.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 19, 2016
@bestander
Copy link
Contributor

Thanks, Andrew.

I'll keep an eye on the issue.
Feel free to nudge if there are some changes about it.

On Tuesday, 19 July 2016, Andrew Jack notifications@github.com wrote:

@bestander https://github.com/bestander ok well in the meantime people
can add the latest okhttp dependency as a workaround.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8672 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACBdWF1vKSTc0ebC152BFQvGxQDPkl46ks5qXN7PgaJpZM4JIqVG
.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 19, 2016
@bestander
Copy link
Contributor

actually my team mates decided to do the robolectrick hack to unblock this, so we will be landing this soon, @AndrewJack

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 19, 2016
@ghost ghost closed this in c47f745 Jul 20, 2016
fadils pushed a commit to fadils/react-native that referenced this pull request Jul 21, 2016
Summary:
- 3.3.1 wasn't compatible with Robolectric 3.0, however 3.4.0 [fixes](square/okhttp#2533 (comment)) this issue.
- Few other fixes to OkHttp mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

> Fixes: facebook#7743
>
- Android apps can recover from a `REFUSED_STREAM` in HTTP/2.
- A few other fixes mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

- CircleCi
- Test with `/Examples` ✅
Closes facebook#8672

Reviewed By: alsutton

Differential Revision: D3541293

Pulled By: bestander

fbshipit-source-id: 76429861b4f4df15cb9c18ab0f177daee3e1459d
bubblesunyum pushed a commit to iodine/react-native that referenced this pull request Aug 23, 2016
Summary:
- 3.3.1 wasn't compatible with Robolectric 3.0, however 3.4.0 [fixes](square/okhttp#2533 (comment)) this issue.
- Few other fixes to OkHttp mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

> Fixes: facebook#7743
>
- Android apps can recover from a `REFUSED_STREAM` in HTTP/2.
- A few other fixes mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

- CircleCi
- Test with `/Examples` ✅
Closes facebook#8672

Reviewed By: alsutton

Differential Revision: D3541293

Pulled By: bestander

fbshipit-source-id: 76429861b4f4df15cb9c18ab0f177daee3e1459d
mpretty-cyro pushed a commit to HomePass/react-native that referenced this pull request Aug 25, 2016
Summary:
- 3.3.1 wasn't compatible with Robolectric 3.0, however 3.4.0 [fixes](square/okhttp#2533 (comment)) this issue.
- Few other fixes to OkHttp mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

> Fixes: facebook#7743
>
- Android apps can recover from a `REFUSED_STREAM` in HTTP/2.
- A few other fixes mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

- CircleCi
- Test with `/Examples` ✅
Closes facebook#8672

Reviewed By: alsutton

Differential Revision: D3541293

Pulled By: bestander

fbshipit-source-id: 76429861b4f4df15cb9c18ab0f177daee3e1459d
tungdo194 pushed a commit to tungdo194/rn-test that referenced this pull request Apr 28, 2024
Summary:
- 3.3.1 wasn't compatible with Robolectric 3.0, however 3.4.0 [fixes](square/okhttp#2533 (comment)) this issue.
- Few other fixes to OkHttp mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

> Fixes: #7743
>
- Android apps can recover from a `REFUSED_STREAM` in HTTP/2.
- A few other fixes mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

- CircleCi
- Test with `/Examples` ✅
Closes facebook/react-native#8672

Reviewed By: alsutton

Differential Revision: D3541293

Pulled By: bestander

fbshipit-source-id: 76429861b4f4df15cb9c18ab0f177daee3e1459d
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Fix OkHttp REFUSED_STREAM by upgrading to OkHttp 3.3
4 participants