Zip-based resources render blank on Chromium 80–102 because DecompressionStream lacks 'deflate-raw'
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: release-v0.20.x
Observed behavior
- On the Android app's system WebView (Chrome 83, Android 11 emulator), opening a Bloom book leaves the player pane blank grey.
packages/kolibri-zip/src/index.js#L16-L22turns on zip.jsuseCompressionStreamwheneverCompressionStreamexists. Chromium 80–102 has the API but only gained thedeflate-rawformat in 103.- With
CompressionStream/DecompressionStreamdeleted from the WebView before load, zip.js falls back to its own inflater and the same book renders and pages to completion. - The Bloom, H5P, Perseus, QTI and safe HTML5 viewers all read their files through kolibri-zip. Only Bloom was exercised.
Errors and logs
WebView console (adb logcat chromium:I *:S):
"Handler loading/initialization failed: TypeError: Failed to construct 'DecompressionStream': Unsupported compression format: 'deflate-raw'", source: http://127.0.0.1:43351/content/static/sandbox/sandbox-bc285b08dd709cc07c27.js (2)
User-facing consequences
- Learners on devices with a WebView or browser between Chromium 80 and 102 get a blank pane for zip-based resources. These are common on offline Android devices whose WebView never updates.
Steps to reproduce
- Install the Android app built from
developon an Android 11 emulator (system WebView 83, not updated). - Import a channel containing a Bloom book (e.g. "Papaya" in the Kolibri QA Channel).
- Open the book in Learn.
Acceptance Criteria
- [ ] On Chromium 80–102 (Android WebView 83), a Bloom book, an H5P resource and a safe HTML5 resource render and their sandbox logs no
DecompressionStreamerror. - [ ] Browsers that support
'deflate-raw'still use the nativeDecompressionStream. - [ ] A kolibri-zip unit test fails when
CompressionStreamexists without'deflate-raw'support and zip.js still opts into it.
Context
- Kolibri
0.20.0a2.dev1797+g889bd8ffb(develop at 889bd8ffbb), Android app debug build, Android 11 emulator, WebViewChrome/83.0.4103.106.
AI usage
Claude Code found this during automated QA of a Bloom player PR on the Android emulator. It ran the reproduction, captured the console error and the workaround run, and drafted this issue.
Plan: Zip-based viewers render on Chromium 80–102: kolibri-zip uses native compression streams only where they accept 'deflate-raw', and its fallback codec runs under Kolibri's own CSP.
- [ ] Probe
'deflate-raw'support in kolibri-zip - [ ] Use zip.js's pure-JS codec build
- [ ] Self-review the produced code
Assumptions — the issue did not settle these; say so if one is wrong.
- Chromium 80–102 refuses WebAssembly under the main-app CSP, so kolibri-zip moves to zip.js's pure-JS build: if it does not, the swap only costs older browsers a slower inflater than wasm. Not verifiable off-device; the slow check's safe HTML5 resource on WebView 83 settles it.
- The QA phase's Android emulator (system WebView 83) can verify the first criterion: if it cannot, that criterion needs a person with an Android 11 device.
- Perseus and QTI get no device check, since the first criterion names only Bloom, H5P and safe HTML5: a fault specific to those two on WebView 83 would ship unseen.
- A zip.js bump is out of scope on a release branch: if maintainers prefer one, Task 2's build swap may be redundant with upstream's own handling.
Written by rtibblesbot, an LLM-based coding agent.
Fixed in #16027