Repository navigation
Conversation
When a path-sourced artifact cannot be moved into the upload directory, the uploader copies it and appends a CRC trailer, but recorded the entry as raw. Raw entries are uploaded verbatim, so the CRC was sent as part of the payload. State snapshots are path-sourced, and Loop API rejects them as having trailing data after the zlib stream and drops them for good. Record the copy as checksummed so the reader verifies and strips the CRC. A successful move stays raw. Adds a test that forces the copy fallback and checks the uploaded bytes match the source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The test changes the process-wide working directory without restoring it and then deletes that directory, risking filesystem failures in both concurrent and subsequent tests.
1 open issue
What changed in this PR
Fixes path-source artifact uploads that fall back to copying, preventing the appended checksum trailer from being uploaded as payload data.
Changes:
- Marks copied artifacts as checksummed so their trailers are verified and stripped before upload, while successfully moved artifacts remain raw.
- Adds a regression test checking that copy-fallback uploads contain only the original bytes.
| File | Description |
|---|---|
bd-artifact-upload/src/uploader.rs |
Records the correct storage format for copied and moved path sources. |
bd-artifact-upload/src/uploader_test.rs |
Adds regression coverage for copy-fallback payload integrity. |
Review effort: Balanced
Comment on lines
+2579
to
+2582
| let process_dir = tempfile::tempdir().unwrap(); | ||
| std::env::set_current_dir(process_dir.path()).unwrap(); | ||
| let source_path = std::path::PathBuf::from("snapshot-outside-sdk-dir.zz"); | ||
| std::fs::write(&source_path, b"zlib snapshot").unwrap(); |
Contributor
Author
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

State snapshot uploads can be dropped permanently by Loop API with "trailing data after the zlib stream". When a path-sourced artifact can't be moved into the upload directory, the uploader falls back to a copy that appends a CRC trailer, but recorded the entry as raw, so the CRC was uploaded as part of the payload. The copy is now recorded as checksummed, so the CRC is verified and stripped before upload; a successful move is unchanged.
Mobile SDKs use absolute SDK directories, so the move normally succeeds and the fallback only runs when a rename really fails. logger-cli with a relative
--sdk-directoryhits it on every snapshot, which is how this showed up in a local end-to-end run. Crash profiles are also path-sourced and would have been affected the same way.🤖 Generated with Claude Code