fix(cloud): stamp content_encoding only when compression ran - #3882
Draft
spomichter wants to merge 1 commit into
Draft
fix(cloud): stamp content_encoding only when compression ran#3882spomichter wants to merge 1 commit into
spomichter wants to merge 1 commit into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. @@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 stampedcontent_encoding=lz4, sodimos data pulldecompressed bytes that were never compressed and failed instead of restoring the file.Fix: track whether compression actually ran and stamp
content_encodingonly 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.lz4with non-lz4 bytes uploads withcontent_encoding=Noneand pulls byte-identicalpytest dimos/cloud/test_data.py: 26 passed; mypy reports only the pre-existingcd.timefixture complaint (untouched lines)