{"record":{"id":"7da6d02b1db3acb4","repo":"earendil-works/pi","slug":"invalid-server-protocol-message","errorCode":null,"errorMessage":"Invalid server protocol message","messagePattern":"Invalid server protocol message","errorType":"exception","errorClass":"ProtocolValidationError","httpStatus":null,"severity":"error","filePath":"packages/protocol/src/codec.ts","lineNumber":50,"sourceCode":"\ttry {\n\t\tif (Array.isArray(value)) return value.every((item) => isProtocolValue(item, false, ancestors));\n\t\tif (Object.getPrototypeOf(value) !== Object.prototype) return false;\n\t\treturn Object.values(value).every((item) => isProtocolValue(item, true, ancestors));\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n\nexport function parseClientMessage(value: unknown): ClientMessage {\n\tif (!isProtocolValue(value) || !Check(ClientMessageSchema, value)) {\n\t\tthrow new ProtocolValidationError(\"Invalid client protocol message\");\n\t}\n\treturn value;\n}\n\nexport function parseServerMessage(value: unknown): ServerMessage {\n\tif (!isProtocolValue(value) || !Check(ServerMessageSchema, value)) {\n\t\tthrow new ProtocolValidationError(\"Invalid server protocol message\");\n\t}\n\treturn value;\n}\n\nfunction boundedErrorMessage(error: unknown): string {\n\tif (!(error instanceof Error)) return \"Unknown codec error\";\n\treturn error.message.length <= 500 ? error.message : `${error.message.slice(0, 497)}...`;\n}\n\nfunction encodeProtocolMessage<T>(\n\tvalue: T,\n\tparse: (candidate: unknown) => T,\n\tkind: string,\n\toptions?: FrameDecoderOptions,\n): Uint8Array {\n\tconst validated = parse(value);\n\ttry {\n\t\tconst maxFrameLength = options?.maxFrameLength ?? DEFAULT_MAX_FRAME_LENGTH;","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/protocol/src/codec.ts#L32-L68","documentation":"Error \"Invalid server protocol message\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/protocol/src/codec.ts:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The server sent a malformed protocol message; verify the server and client versions match."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}