Files
KSP-MissionControl/packages/krpc-client
Mavis 639d265278 fix: decode error bytes as Error protobuf (not as a pre-decoded object)
The kRPC Response and ProcedureResult messages use `bytes` for
their `error` fields — a serialized Error sub-message, not a
pre-decoded object. We were treating them as already-decoded,
which produced 'RPC error: .:`\u2426' (empty service.name.description
with a stray substitute character) and triggered 'invalid wire
type 4 / 7' errors when the bytes happened to look like other
protobuf structures.

Same bug existed in three places:
1. invoke() - top-level Response.error and per-call results[i].error
2. addStream() - results[i].error
3. readStreamLoop() - StreamResult.result.error

Fix: when an error field is set and non-empty, decode the bytes
as a kRPC.Error message to get service/name/description/stackTrace.
If the inner decode fails, fall back to a hex dump so we still
see something useful in the logs.

Stream errors are logged as warnings and produce empty values
so the stream loop keeps running for the other streams.
2026-06-03 00:15:00 +00:00
..