Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion lib/storage/metadata/MetadataWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,27 @@ function _parseListEntries(entries) {
};
}

// Fall back to dataStoreETag when content-md5 is absent (e.g. parts
// written by ring-s3-rdma-http which stores ETag only as "1:<hex>").
let etag = tmp['content-md5'];
if (!etag) {
const loc = Array.isArray(tmp.partLocations)
? tmp.partLocations[0]
: tmp.partLocations;
const dst = loc && loc.dataStoreETag;
if (dst) {
const colon = dst.indexOf(':');
if (colon !== -1) {
etag = dst.slice(colon + 1);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests cover _parseListEntries today, and this adds non-trivial branching (array vs single location, colon parsing). Consider adding a unit test that exercises at least: (1) content-md5 present (existing behavior), (2) content-md5 absent with partLocations array containing a dataStoreETag like "1:abc123", (3) content-md5 absent with no partLocations.

— Claude Code

}

return {
key: entry.key,
value: {
Size: tmp['content-length'],
ETag: tmp['content-md5'],
ETag: etag,
VersionId: tmp.versionId,
IsNull: tmp.isNull,
IsDeleteMarker: tmp.isDeleteMarker,
Expand Down
Loading