Skip to content

fix(cloud): stamp content_encoding only when compression ran - #3882

Draft
spomichter wants to merge 1 commit into
mainfrom
fix/codec-stamp
Draft

fix(cloud): stamp content_encoding only when compression ran#3882
spomichter wants to merge 1 commit into
mainfrom
fix/codec-stamp

Conversation

@spomichter

Copy link
Copy Markdown
Contributor

Summary

Greptile P1 on #3865 (#3865 (comment)), confirmed: a file already carrying the codec's suffix (any *.lz4, whatever its bytes) skips compression but was still stamped content_encoding=lz4, so dimos data pull decompressed bytes that were never compressed and failed instead of restoring the file.

Fix: track whether compression actually ran and stamp content_encoding only then (also collapses the duplicated suffix condition). Files named like the codec now round-trip raw and byte-identical.

Test plan

  • test_matching_suffix_uploads_raw_and_unstamped: artifact.lz4 with non-lz4 bytes uploads with content_encoding=None and pulls byte-identical
  • pytest dimos/cloud/test_data.py: 26 passed; mypy reports only the pre-existing cd.time fixture complaint (untouched lines)

A file already carrying the codec suffix (any *.lz4) uploaded raw but was
stamped content_encoding=lz4, so pull decompressed bytes that were never
compressed and failed.
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3882      +/-   ##
==========================================
- Coverage   77.83%   77.83%   -0.01%     
==========================================
  Files        1329     1329              
  Lines      126864   126872       +8     
  Branches    11034    11033       -1     
==========================================
+ Hits        98750    98755       +5     
- Misses      24962    24967       +5     
+ Partials     3152     3150       -2     
Flag Coverage Δ
OS-ubuntu-24.04-arm 74.55% <100.00%> (-0.01%) ⬇️
OS-ubuntu-latest 75.08% <100.00%> (+<0.01%) ⬆️
Py-3.10 75.08% <100.00%> (+<0.01%) ⬆️
Py-3.11 75.08% <100.00%> (+<0.01%) ⬆️
Py-3.12 75.08% <100.00%> (+<0.01%) ⬆️
Py-3.13 75.07% <100.00%> (-0.01%) ⬇️
Py-3.14 75.08% <100.00%> (-0.01%) ⬇️
Py-3.14t 75.08% <100.00%> (+<0.01%) ⬆️
SelfHosted-Large 30.20% <10.00%> (-0.01%) ⬇️
SelfHosted-Linux 34.64% <10.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/cloud/data.py 90.47% <100.00%> (+1.42%) ⬆️
dimos/cloud/test_data.py 99.21% <100.00%> (+0.02%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant