Decode buf[start..end) as strict UTF-8 — the whole of buf when the range
is omitted, which is the shape a reassembled payload (see PayloadAcc)
arrives in.
Malformed bytes throw a SofabError (INVALID_MSG), never the fatal
TextDecoder's bare TypeError. The mapping belongs here rather than at
each call site: invalid UTF-8 is an invalid message (MESSAGE_SPEC §8,
CORELIB_PLAN §6.4), so it has to reach a caller as the same INVALID verdict
as every other malformation — through the one catch (e) { if (e instanceof SofabError) … } a consumer writes — and a platform exception escaping that
clause is precisely the bug this closes.
A zero-length payload is the empty string, decoded without touching the
platform decoder.
Decode
buf[start..end)as strict UTF-8 — the whole ofbufwhen the range is omitted, which is the shape a reassembled payload (see PayloadAcc) arrives in.Malformed bytes throw a SofabError (
INVALID_MSG), never the fatal TextDecoder's bareTypeError. The mapping belongs here rather than at each call site: invalid UTF-8 is an invalid message (MESSAGE_SPEC §8, CORELIB_PLAN §6.4), so it has to reach a caller as the sameINVALIDverdict as every other malformation — through the onecatch (e) { if (e instanceof SofabError) … }a consumer writes — and a platform exception escaping that clause is precisely the bug this closes.A zero-length payload is the empty string, decoded without touching the platform decoder.