{"record":{"id":"b0af1f7e0e2ddeaa","repo":"tonhowtf/omniget","slug":"compressionstream-indispon-vel-neste-runtime","errorCode":null,"errorMessage":"CompressionStream indisponível neste runtime","messagePattern":"CompressionStream indisponível neste runtime","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/study-components/notes/PlantumlView.svelte","lineNumber":119,"sourceCode":"      const c1 = b1 >> 2;\n      const c2 = ((b1 & 0x3) << 4) | (b2 >> 4);\n      const c3 = ((b2 & 0xf) << 2) | (b3 >> 6);\n      const c4 = b3 & 0x3f;\n      result +=\n        PLANT_ALPHABET[c1 & 0x3f] +\n        PLANT_ALPHABET[c2 & 0x3f] +\n        PLANT_ALPHABET[c3 & 0x3f] +\n        PLANT_ALPHABET[c4 & 0x3f];\n    }\n    return result;\n  }\n\n  async function compressForUrl(text: string): Promise<string> {\n    const G = globalThis as unknown as {\n      CompressionStream?: new (format: string) => GenericTransformStream;\n    };\n    if (!G.CompressionStream) {\n      throw new Error(\"CompressionStream indisponível neste runtime\");\n    }\n    const ds = new G.CompressionStream(\"deflate-raw\");\n    const stream = new Blob([text]).stream().pipeThrough(ds);\n    const compressed = await new Response(stream).arrayBuffer();\n    return deflateBase64(new Uint8Array(compressed));\n  }\n\n  async function renderRemote(src: string) {\n    const token = ++renderToken;\n    const trimmed = src.trim();\n    if (!trimmed) return;\n    renderState = { kind: \"remote-rendering\" };\n    try {\n      const encoded = await compressForUrl(trimmed);\n      if (token !== renderToken) return;\n      const url = `https://www.plantuml.com/plantuml/svg/~1${encoded}`;\n      const resp = await fetch(url);\n      if (!resp.ok) {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/study-components/notes/PlantumlView.svelte#L101-L137","documentation":"Capability guard in compressForUrl: the globalThis.CompressionStream API is missing in the current runtime (older browser or non-secure context), so the PlantUML text cannot be deflate-compressed for an encoded server URL.","triggerScenarios":"Thrown at src/lib/study-components/notes/PlantumlView.svelte:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Feature-detect CompressionStream before offering the encoded-URL rendering path","Fall back to sending the raw (uncompressed) PlantUML source to the server","Polyfill CompressionStream (e.g. via a wasm deflate implementation) for runtimes that lack it"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}