{"record":{"id":"0549086aeaa4815d","repo":"davila7/claude-code-templates","slug":"decompression-failed-error-message","errorCode":null,"errorMessage":"Decompression failed: ${error.message}","messagePattern":"Decompression failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli-tool/src/index.js","lineNumber":2199,"sourceCode":"    }\n  }\n}\n\n/**\n * Decompress string with Unicode support\n */\nfunction decompressString(compressed) {\n  try {\n    // Simple Base64 decoding with Unicode support\n    const decoded = Buffer.from(compressed, 'base64').toString('utf8');\n    // Convert URI encoded characters back\n    return decodeURIComponent(decoded.replace(/(.)/g, function(m, p) {\n      let code = p.charCodeAt(0).toString(16).toUpperCase();\n      if (code.length < 2) code = '0' + code;\n      return '%' + code;\n    }));\n  } catch (error) {\n    throw new Error(`Decompression failed: ${error.message}`);\n  }\n}\n\n/**\n * Fetch workflow data from hash\n * In production, this would fetch from a remote workflow registry\n * For now, we'll simulate this functionality\n */\nasync function fetchWorkflowData(hash) {\n  try {\n    // Check if hash contains encoded data (new format: shortHash_encodedData)\n    if (hash.includes('_')) {\n      console.log(chalk.green('🔓 Decoding workflow from hash...'));\n      \n      const [shortHash, encodedData] = hash.split('_', 2);\n      \n      if (!encodedData) {\n        throw new Error('Invalid hash format: missing encoded data');","sourceCodeStart":2181,"sourceCodeEnd":2217,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/index.js#L2181-L2217","documentation":"Wrapped decode error from decompressWorkflow: the hash's compressed payload (after the '_') was percent-encoded, decoded, then run through decompression; any failure (corrupt data, wrong decompression impl, invalid UTF-8 after decodeURIComponent) is rethrown as 'Decompression failed: <cause>'.","triggerScenarios":"A hash of form 'short_compressedData' where the compressed segment is truncated or URL-mangled (e.g. '+'→' ' by a URL decoder), so the decompression step throws; the underlying cause is included in the message.","commonSituations":"Hashes pasted through channels that URL-decode or truncate (chat apps, terminals with line-wrap copy); hashes generated by an incompatible version of the compressor.","solutions":["Re-copy the hash verbatim, avoiding URL-decoding transformations (watch for '+' vs ' ')","Regenerate the share link from the source dashboard","Upgrade both ends (generator and CLI) to matching versions","Note the underlying error.message to identify whether it failed at pako decompress or decodeURIComponent"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"null","typeGuard":null,"tryCatchPattern":"try {\n  await installWorkflowFromHash(hash);\n} catch (e) {\n  if (/Decompression failed/.test(e.message)) {\n    console.error('Hash payload corrupted in transit — recopy the full share link');\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Copy hashes via clipboard (share button), never terminal text selection with line-wrap","Avoid passing hashes through systems that URL-decode them","Keep generator and CLI versions in sync"],"tags":["workflow-hash","decompression","encoding","cli"],"backgroundTag":"corrupt-encoded-payload","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}