{"record":{"id":"be9fed7cb9455a8e","repo":"qishibo/AnotherRedisDesktopManager","slug":"zlib-deflateraw-parse-failed","errorCode":null,"errorMessage":"Zlib DeflateRaw Parse Failed!","messagePattern":"Zlib DeflateRaw Parse Failed!","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/viewers/ViewerDeflateRaw.vue","lineNumber":26,"sourceCode":"\nconst zlib = require('zlib');\n\nexport default {\n  components: { JsonEditor },\n  props: ['content'],\n  computed: {\n    newContent() {\n      const { formatStr } = this;\n\n      if (typeof formatStr === 'string') {\n        if (this.$util.isJson(formatStr)) {\n          return JSONbig.parse(formatStr);\n        }\n\n        return formatStr;\n      }\n\n      return 'Zlib DeflateRaw Parse Failed!';\n    },\n    formatStr() {\n      return this.$util.zippedToString(this.content, 'deflateRaw');\n    },\n  },\n  methods: {\n    getContent() {\n      const content = this.$refs.editor.getRawContent(true);\n      return zlib.deflateRawSync(content);\n    },\n    copyContent() {\n      return this.formatStr;\n    },\n  },\n};\n</script>\n","sourceCodeStart":8,"sourceCodeEnd":43,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/viewers/ViewerDeflateRaw.vue#L8-L43","documentation":"Placeholder string shown in the raw-deflate viewer when decompression fails. formatStr calls $util.zippedToString(content, 'deflateRaw') → zlib.inflateRawSync, which expects a bare DEFLATE stream with no zlib header or checksum. Any throw or empty output makes formatStr false and newContent renders 'Zlib DeflateRaw Parse Failed!', meaning the bytes are not a valid raw deflate stream.","triggerScenarios":"Viewing a key labeled deflateRaw that actually carries a zlib wrapper (78 xx header) — inflateRawSync fails on the bogus first byte; truncated stream; data produced by gzip with the header stripped incorrectly; empty output mapping to false.","commonSituations":"WebSocket permessage-deflate fragments (raw deflate) confused with zlib-wrapped deflate; Redis values written from Node zlib.deflateRawSync vs zlib.deflateSync mixed up between services; corruption from partial writes.","solutions":["Hex-check the payload: raw deflate has no 78 xx header — if present, switch to the Deflate viewer","Confirm the writer used raw mode (zlib.deflateRawSync / flate -raw / Z_RAW)","Check for truncation or double encoding before the deflate layer","Standardize producer and viewer on one deflate variant"],"exampleFix":"// before\nreturn 'Zlib DeflateRaw Parse Failed!';\n\n// after - propagate the zlib reason\ntry {\n  return zlib.inflateRawSync(buf).toString();\n} catch (e) {\n  return `Zlib DeflateRaw Parse Failed: ${e.message}`;\n}","handlingStrategy":"type-guard","validationCode":"const ok = typeof this.$util.zippedToString(buf, 'deflateRaw') === 'string';\nif (!ok) { /* fall back to zlib-wrapped deflate viewer / hex */ }","typeGuard":"const isRawDeflate = (buf) => typeof $util.zippedToString(buf, 'deflateRaw') === 'string';","tryCatchPattern":null,"preventionTips":["Confirm the producer used raw mode (deflateRawSync / Z_RAW / flate -raw)","Remember raw deflate has no 78 xx wrapper — its presence means the Deflate viewer applies","Strip outer hex/base64 layers before expecting raw deflate bytes"],"tags":["deflate-raw","zlib","decompression","vue","redis-viewer"],"backgroundTag":"zlib-decompress-failed","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}