https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
c

Colton Idle

11/27/2023, 5:51 PM
Our team has a strict policy on fixing all Strict mode violations. Last comment was two years ago... anyone know off the cuff if anything has changed, or can should I just say that it's infeasible to fix for now? https://github.com/square/okhttp/issues/3537
e

eygraber

11/27/2023, 5:56 PM
I think it's a Firebase issue not okhttp
c

Colton Idle

11/27/2023, 6:03 PM
Hm. I dont think we use firebase
y

yschimke

11/27/2023, 6:48 PM
OkHttp can't (or won't) do this automatically. If you control the client you can do It yourself. If it's in firebase or another SDK you should ask them to expose a way to set a Call.Factory or OkHttpClient
c

Colton Idle

11/27/2023, 7:54 PM
It's my own okhttp client! so it sounds like I can do something about it. cool.
y

yschimke

11/27/2023, 7:56 PM
Yep. Just use a custom Socket factory, do whatever you need in there
c

Colton Idle

11/28/2023, 12:45 PM
Cool. I'll give it a whirl. I don't "want" to use a custom socket factory or anything. It just seems like i want to do the least invasive thing possible to make that warning from StrictMode go away
y

yschimke

11/28/2023, 2:19 PM
BTW If OkHttp did this automatically, then it would completely defeat the purpose of StrictMode socket tagging. Every socket connection would be pre-tagged. So I think the OkHttp API here is about right.
c

Colton Idle

11/28/2023, 4:30 PM
That's a good point because I was definitely thinking "why doesn't okhttp update to prevent this"