{"record":{"id":"6fbdd730c49f7b1a","repo":"can1357/oh-my-pi","slug":"unsupported-wire-type-wiretype-in-listvalue","errorCode":null,"errorMessage":"Unsupported wire type ${wireType} in ListValue","messagePattern":"Unsupported wire type (.+?) in ListValue","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/catalog/src/discovery/protobuf.ts","lineNumber":1063,"sourceCode":"\t\t\t\t\tentryReader.skip(entryWire);\n\t\t\t\t}\n\t\t\t}\n\t\t\toutput[entryKey] = entryVal;\n\t\t} else {\n\t\t\treader.skip(wireType);\n\t\t}\n\t}\n\treturn output;\n}\n\nfunction readJsonList(reader: Reader): JsonValue[] {\n\tconst list: JsonValue[] = [];\n\twhile (reader.pos < reader.len) {\n\t\tconst tag = reader.uint32();\n\t\tconst fieldNumber = tag >>> 3;\n\t\tconst wireType = tag & 7;\n\t\tif (!isWireType(wireType)) {\n\t\t\tthrow new Error(`Unsupported wire type ${wireType} in ListValue`);\n\t\t}\n\t\tif (fieldNumber === 1) {\n\t\t\tassertWireType(wireType, 2);\n\t\t\tlist.push(readJsonValue(new Reader(reader.bytes())));\n\t\t} else {\n\t\t\treader.skip(wireType);\n\t\t}\n\t}\n\treturn list;\n}\n","sourceCodeStart":1045,"sourceCodeEnd":1074,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/catalog/src/discovery/protobuf.ts#L1045-L1074","documentation":"Same manual protobuf guard as the Struct decoder, but for google.protobuf.ListValue: a field tag carrying a wire type not in the supported set aborts decoding. ListValue is a repeated message, so an unsupported wire type means the stream is not valid protobuf for this schema.","triggerScenarios":"Decoding a ListValue whose tag byte encodes a wire type outside the supported range (e.g. malformed varint stream, wire type 6/7).","commonSituations":"Truncated binary response, middleware corrupting binary bodies, or a provider changing serialization in a way the hand-rolled reader can't handle.","solutions":["Check the HTTP response for corruption/injected error pages in the binary body","Retry the discovery request; transient truncation is common","Upgrade the catalog package to pick up decoder fixes","Report the failing payload upstream with a hex dump"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const list = decodeListValue(reader);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unsupported wire type\")) {\n    logger.warn(\"Malformed protobuf ListValue; retrying fetch\", { cause: err });\n    return retryFetch();\n  }\n  throw err;\n}","preventionTips":["Retry transient binary fetches; truncation causes invalid wire types","Avoid proxies that rewrite response bodies","Track catalog updates for protobuf decoder fixes"],"tags":["protobuf","decoding","wire-type"],"backgroundTag":"protobuf-decode-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}