{"record":{"id":"a81c6886755f58e0","repo":"qishibo/AnotherRedisDesktopManager","slug":"zlib-deflate-parse-failed","errorCode":null,"errorMessage":"Zlib Deflate Parse Failed!","messagePattern":"Zlib Deflate Parse Failed!","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/viewers/ViewerDeflate.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 Deflate Parse Failed!';\n    },\n    formatStr() {\n      return this.$util.zippedToString(this.content, 'deflate');\n    },\n  },\n  methods: {\n    getContent() {\n      const content = this.$refs.editor.getRawContent(true);\n      return zlib.deflateSync(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/ViewerDeflate.vue#L8-L43","documentation":"Placeholder string shown in the deflate viewer when decompression fails. formatStr calls $util.zippedToString(content, 'deflate') → zlib.inflateSync, which expects a zlib-wrapped deflate stream (78 xx header + Adler-32 trailer). Any throw or empty output makes formatStr false, and newContent displays 'Zlib Deflate Parse Failed!' meaning the bytes are not a valid zlib-wrapped deflate stream.","triggerScenarios":"Viewing a key labeled deflate whose bytes are actually raw deflate (no zlib wrapper) — inflateSync throws 'incorrect header check'; truncated stream → 'unexpected end of file'; stream produced by a non-zlib container (e.g. HTTP chunk framing still attached); empty decompressed output also maps to false.","commonSituations":"Writers using raw deflate (Z_SYNC_FLUSH websocket frames, 'deflate-raw') versus zlib-wrapped deflate confusion; content that is deflate-compressed then hex/base64 encoded with the outer layer not stripped; corrupted values from partial writes.","solutions":["Check the first bytes: zlib-wrapped deflate starts with 78 01/9c/da; otherwise switch to the DeflateRaw viewer","Verify the stream is complete (Adler-32 trailer present) in the hex view","Strip any outer encoding (hex/base64) before expecting deflate bytes","Fix the producer to emit zlib.deflateSync output if you standardize on this viewer"],"exampleFix":"// before\nreturn 'Zlib Deflate Parse Failed!';\n\n// after - propagate the zlib reason\ntry {\n  return zlib.inflateSync(buf).toString();\n} catch (e) {\n  return `Zlib Deflate Parse Failed: ${e.message}`;\n}","handlingStrategy":"type-guard","validationCode":"const ok = typeof this.$util.zippedToString(buf, 'deflate') === 'string';\nif (!ok) { /* fall back to deflateRaw / hex viewer */ }","typeGuard":"const isZlibDeflate = (buf) => typeof $util.zippedToString(buf, 'deflate') === 'string';","tryCatchPattern":null,"preventionTips":["Standardize writers on zlib-wrapped deflate (zlib.deflateSync) when using this viewer","Check the 78 xx zlib header in hex view before assuming the mode","Use the app's isDeflate detection to pick the viewer automatically"],"tags":["deflate","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"}