Wow, ok so here’s a VERY weird one. After updating...
# kotlin-native
r
Wow, ok so here’s a VERY weird one. After updating to 1.3.70, one of my endpoints implementation with ktor sends a completely wrong body. It’s the endpoint for login, and it sends a completely different endpoint body. Like, another serializable request body that isn’t even defined in the same gradle module. Only occurs in simulator and not on device. Wtf?
Exact same code for both platforms:
Copy code
val res = <http://http.post|http.post><LoginResponse>("$baseUrl$postLoginPath") {
            contentType(Application.Json)
            body = LoginPayload(login, password, appId)
        }
Logs:
Copy code
HttpClient: INFO - 54D783 POST https://$baseUrl/$postLoginPath
HttpClient: DEBUG - Headers:
Accept: application/json
Accept-Charset: UTF-8
HttpClient: DEBUG - Body:
{
   "imageConsent": false,
   "rightsConsent": false
}
This somehow finds a way to send this body
Copy code
@Serializable
internal data class ConsentsPayload(
    val imageConsent: Boolean,
    val rightsConsent: Boolean
)
Seriously wtf, how? Wrong address somehow? Maybe a +1 on an index in kotlinx.serialization? This is absurd
The module implementing the authentication endpoint doesn’t even know the module with this other model
@e5l there’s absolutely no way I make a reproducer for this one I think 😄
👀 1
e
@sandwwraith could you take a look?
r
This absolutely never occurs on device and always occurs in simulator. Also reproduced with a different build of all modules/app involved with slightly different codebases, as it was reported to me by a colleague (I didn’t trust him at first, this is so absurd)
s
Are these builds for the iOS simulator? If so try deleting Xcode’s derived data folder contents under
~/Library/Developer/Xcode/DerivedData
. Often times when things go weird like that, it’s a problem with derived data not being refreshed when it is supposed to be.
r
I already rollbacked to 1.3.61, and it’s not an easy task to swap versions. My coworker still has the buggy version, I’ll see if he can try removing deriveddata but afaik he already tried it. Also I reproduced it on my own machine so I doubt it’s this kind of bug
s
Yeah, it’s a long shot.