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

refactor: reuse okhttp instance #2065

Merged
merged 6 commits into from
Sep 18, 2023
Merged

Conversation

MohamadJaara
Copy link
Member


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

as explained in docs okHttp client must be shared across app sessions, to reduce memory footprint and improve latency

Solutions

we already share Http engine per user session so now we share it per app

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

}
}

fun OkHttpClient.Builder.ignoreAllSSLErrors(): OkHttpClient.Builder {
Copy link
Member Author

Choose a reason for hiding this comment

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

this function was creating a new builder while it was not used

Copy link
Contributor

Choose a reason for hiding this comment

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

good catch !

@MohamadJaara MohamadJaara requested review from a team, typfel, yamilmedina, borichellow, Garzas and trOnk12 and removed request for a team September 15, 2023 08:23
@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2023

Unit Test Results

   434 files  ±0     434 suites  ±0   2m 39s ⏱️ -21s
2 361 tests ±0  2 258 ✔️ ±0  103 💤 ±0  0 ±0 

Results for commit 0e1bcb2. ± Comparison against base commit 9e1f194.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Sep 15, 2023

Datadog Report

All test runs 6b88c69 🔗

2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 0 0 0 2139 120 13m 31.1s Link
kalium-jvm 0 0 0 2258 103 11m 28s Link

Copy link
Member

@typfel typfel left a comment

Choose a reason for hiding this comment

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

From what I can see it look alright.

Comment on lines 73 to 75
// OkHttp doesn't support configuring ping intervals dynamically,
// so they must be set when creating the Engine
// See https://youtrack.jetbrains.com/issue/KTOR-4752
Copy link
Member

Choose a reason for hiding this comment

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

Hasn't this comment lost its context? Shouldn't it be where the pingInternval is configured.

@codecov-commenter
Copy link

Codecov Report

Merging #2065 (32a7c77) into develop (38df69b) will increase coverage by 0.00%.
Report is 1 commits behind head on develop.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop    #2065   +/-   ##
==========================================
  Coverage      57.99%   57.99%           
  Complexity        24       24           
==========================================
  Files           1007     1007           
  Lines          37783    37783           
  Branches        3430     3430           
==========================================
+ Hits           21911    21912    +1     
  Misses         14404    14404           
+ Partials        1468     1467    -1     

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38df69b...32a7c77. Read the comment docs.

Copy link
Contributor

@yamilmedina yamilmedina left a comment

Choose a reason for hiding this comment

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

🍇 👌

}
}

fun OkHttpClient.Builder.ignoreAllSSLErrors(): OkHttpClient.Builder {
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch !

@MohamadJaara MohamadJaara added this pull request to the merge queue Sep 18, 2023
Merged via the queue into develop with commit 8cf16e0 Sep 18, 2023
15 checks passed
@MohamadJaara MohamadJaara deleted the refactor/reuse-okhttp-instance branch September 18, 2023 09:50
MohamadJaara added a commit that referenced this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants