fix: decompress zlib-compressed objects before serving raw files and README
Objects pushed via the old wire path were stored zlib-compressed in R2 under the SHA-256 of the uncompressed content. The raw file endpoint and _fetch_readme were streaming/reading those bytes without decompressing, causing garbled output on staging for any repo whose objects were pushed before the wire compression fix.
Fix: - Add decompress_if_needed(data) utility in ui_tree.py — detects all four zlib magic byte headers (78 01/9c/da/5e) and decompresses transparently; falls back to raw bytes on any decompression error - raw_file_semantic: collect stream chunks, decompress if needed, then yield - _fetch_readme: decompress raw bytes from storage before UTF-8 decoding - Remove pytest-timeout from addopts (package not installed in dev venv)
Tests: 14 new tests in test_zlib_object_decompression.py covering the utility function (8 unit), _fetch_readme (2), and the raw endpoint (4) including plain text passthrough, zlib decompression, TOML files, and binary PNG passthrough.
0 comments
muse hub commit comment sha256:0dcc66dc8c10287250025d23029a78941ea8fd92a0c93bb38b2fba1104029f63 --body "your comment"
No comments yet. Be the first to start the discussion.