Salah Loukili
06/19/2026, 7:29 PMcom.google.protobuf.kotlin.Struct uses Double for numeric values (Kind.NumberValue(public val value: Double)), so we face a precision loss when converting to Long for example.
Consider this case where the client is sending a mapOf("key" to Long.MAX_VALUE - 1) , the server when parsing this to Map<String, Long> it has to read the double value of NumberValue and call .toLong() which will end up with a different value
[Client] message={key=9223372036854775806}
[Server] message={key=9223372036854775807}
Is this a known issue? Any ideas how to overcome this?
The full example can be found at https://github.com/salah3x/kotlin-rpc-struct-bugAlexander Sysoev
06/20/2026, 7:59 AM