fix Live Call: include type field in WS protocol messages
encodeDefaults=false caused kotlinx.serialization to skip the type="setup" field since it was a default value. The server's parseClientMessage needs the type field to dispatch — without it every setup message was rejected as "malformed_message". Changed to encodeDefaults=true + explicitNulls=false so type is always serialized but null optionals are still omitted.
This commit is contained in:
parent
8af2ec8259
commit
45eb5dfaea
1 changed files with 1 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ import kotlinx.serialization.json.jsonPrimitive
|
|||
import kotlinx.serialization.json.long
|
||||
import kotlinx.serialization.json.longOrNull
|
||||
|
||||
private val json = Json { ignoreUnknownKeys = true; encodeDefaults = false }
|
||||
private val json = Json { ignoreUnknownKeys = true; encodeDefaults = true; explicitNulls = false }
|
||||
|
||||
// ─── Client → Server ──────────────────────────────────────────────────────
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue