fix(r2): report source digest/size for mounted-blob HEAD (builds on #121)#139
Open
m-ferrero wants to merge 3 commits into
Open
fix(r2): report source digest/size for mounted-blob HEAD (builds on #121)#139m-ferrero wants to merge 3 commits into
m-ferrero wants to merge 3 commits into
Conversation
This was referenced Jun 21, 2026
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.
Problem
A HEAD on a mounted (cross-repo) blob returns the symlink object's own digest/size instead of the source blob's. #121 set out to fix this; this PR builds on that approach and corrects a defect in it: the symlink checksum-mismatch test compares the raw R2 checksum (
ArrayBuffer) to a hex string, which does not type-check and, at runtime, is always true — so every digest-addressed blob would be routed through symlink resolution.Solution
Credit and carry #121's approach (record the source digest/size on the symlink object's metadata; resolve HEAD through
layerExists, with a fallback for symlinks created before the fix), then fix the comparison to put fullsha256:…digest strings on both sides (viahexToDigest), so a normal blob compares equal (no mismatch) and only a real symlink object mismatches.Tests
Adds regression coverage for cross-repo mounted-blob HEAD returning the source digest/size.
Builds on #121 by @mushanyoung.