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

Network library changes #542

Merged
merged 1 commit into from
Jun 6, 2023
Merged

Conversation

julioromano
Copy link

  • Allows for http2
  • Caches a global instance of kotlinx-serialization Json and configures it with a bit more leniency.
  • Moves okhttp's dependency strings to the .toml file
  • Switches off logging for release builds

@julioromano julioromano marked this pull request as ready for review June 6, 2023 09:32
@julioromano julioromano requested a review from a team as a code owner June 6, 2023 09:32
@julioromano julioromano requested review from ganfra and bmarty and removed request for a team and ganfra June 6, 2023 09:32
@julioromano julioromano force-pushed the misc/julioromano/network_lib_changes branch from 7f92e1d to eb55ff3 Compare June 6, 2023 12:42
- Allows for http2
- Caches a global instance of kotlinx-serialization `Json` and configures it with a bit more leniency.
- Moves okhttp's dependency strings to the .toml file
- Switches off logging for release builds
@julioromano julioromano force-pushed the misc/julioromano/network_lib_changes branch from eb55ff3 to 2cbefc3 Compare June 6, 2023 12:43
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/N9Pj7z

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (6497a3f) 51.35% compared to head (2cbefc3) 51.35%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #542   +/-   ##
========================================
  Coverage    51.35%   51.35%           
========================================
  Files          762      762           
  Lines        18511    18510    -1     
  Branches      3990     3990           
========================================
  Hits          9506     9506           
+ Misses        7344     7343    -1     
  Partials      1661     1661           
Impacted Files Coverage Δ
...element/android/libraries/network/NetworkModule.kt 0.00% <0.00%> (ø)
...ement/android/libraries/network/RetrofitFactory.kt 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

): OkHttpClient {
return OkHttpClient.Builder()
// workaround for #4669
.protocols(listOf(Protocol.HTTP_1_1))
Copy link
Member

Choose a reason for hiding this comment

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

It was a workaround for element-hq/element-android#4669, but I guess in this project, we will not have the same issue.

.addInterceptor(httpLoggingInterceptor)
.build()
fun providesJson(): Json = Json {
ignoreUnknownKeys = true
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, I have also added this on my branch, but my branch is far from being mergeable :)

@julioromano julioromano merged commit 98b049e into develop Jun 6, 2023
@julioromano julioromano deleted the misc/julioromano/network_lib_changes branch June 6, 2023 13:33
@bmarty bmarty mentioned this pull request Jun 7, 2023
bmarty pushed a commit that referenced this pull request Jul 19, 2023
- Allows for http2
- Caches a global instance of kotlinx-serialization `Json` and configures it with a bit more leniency.
- Moves okhttp's dependency strings to the .toml file
- Switches off logging for release builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants