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

Check heartbeat bounds #22

Merged
merged 1 commit into from
Feb 4, 2021
Merged

Conversation

bmeike
Copy link
Contributor

@bmeike bmeike commented Feb 4, 2021

OkHttp explodes trying to set a ping interval > MAX_INT. The explosion doesn't happen until the replicator actually tries to connect.

This code uses the same check that OkHttp uses, guaranteeing that if you can set the heartbeat in the config, it will work when the replicator connects.

@bmeike bmeike requested review from pasin and borrrden February 4, 2021 19:46
@@ -21,6 +21,9 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import okhttp3.internal.Util;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's internal!. I'm fine with this but just want to point it out. We probably needs to change a bunch of things when upgrading okhttp anyway incase the internal classes are gone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... It's a very, very fair point.

It was my opinion that it was less fragile to use the exact check that they use, than to try to duplicate a possibly moving target. Absolutely open to opinions to the contrary

@bmeike
Copy link
Contributor Author

bmeike commented Feb 4, 2021

BTW, please note that, although not visible in the PR, this update includes the deprecation (simply marked "deprecated") of LogLevel.getValue()

@bmeike bmeike requested a review from pasin February 4, 2021 21:02
@bmeike bmeike merged commit 250a3fe into android/release/hydrogen Feb 4, 2021
@bmeike bmeike deleted the candidate/2.8.4 branch February 4, 2021 22:32
@bmeike bmeike mentioned this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants