API reference › @evolu/common › local‑first/Protocol › parseProtocolHeader

function parseProtocolHeader(
  inputMessage: Uint8Array,
): Result<ProtocolHeader, ProtocolInvalidDataError>;

Defined in: packages/common/src/local-first/Protocol.ts:428

Parses the ProtocolHeader a transport needs to route a message.

Parsing succeeds for versions this peer cannot process, because a non-initiator answers a version mismatch with only its version and the owner ID. Rejecting that reply here would drop it before applyProtocolMessageAsClient can report ProtocolVersionError.