Skip to content

Inline OkHttpNetworkService#2126

Merged
priettt merged 1 commit intomainfrom
priettt/gradleUploadFix
Apr 25, 2025
Merged

Inline OkHttpNetworkService#2126
priettt merged 1 commit intomainfrom
priettt/gradleUploadFix

Conversation

@priettt
Copy link
Contributor

@priettt priettt commented Apr 25, 2025

Goal

Fixes error:

[EmbraceGradlePlugin] [OkHttpNetworkService] Exception occurred while making network request
java.lang.NullPointerException: Cannot invoke "okhttp3.OkHttpClient.newCall(okhttp3.Request)" because the return value of "io.embrace.android.gradle.plugin.network.OkHttpNetworkService.access$getClient$p(io.embrace.android.gradle.plugin.network.OkHttpNetworkService)" is null

@priettt priettt requested a review from a team as a code owner April 25, 2025 17:27
@github-actions
Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

architecturesToHashedSharedObjectFilesMap
)

val okHttpNetworkService = OkHttpNetworkService(requestParams.get().baseUrl)
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is never reused, any reason why you don't just do the init in NdkUploadHandshake?

Or frankly, just extract that method out of the class and put in in this class? It was initially confusing what we are doing - initializing an object and then throwing it away, when it really is just a method call that internally needs an objet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly because I thought it looked better than inlining 😅

I can change it if you have a strong preference, but we will probably be revisiting this later

Copy link
Contributor

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

LGTM. Comment about why we need to create wrapper object for what is just method call where the networkService creation could just be inlined.

@priettt priettt merged commit ba86fda into main Apr 25, 2025
11 checks passed
@priettt priettt deleted the priettt/gradleUploadFix branch April 25, 2025 21:25
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