fix: strip directory entries and 0-byte files from representations at deploy time#3393
Open
decentraland-bot wants to merge 1 commit intomasterfrom
Open
fix: strip directory entries and 0-byte files from representations at deploy time#3393decentraland-bot wants to merge 1 commit intomasterfrom
decentraland-bot wants to merge 1 commit intomasterfrom
Conversation
… deploy time makeContentFiles already drops 0-byte blobs from the entity content payload, but buildWearableEntityMetadata copies item.data.representations as-is. This leaves directory entries (e.g. male/bin/) and 0-byte files (e.g. male/main.crdt) in the metadata while they are absent from the content — causing Catalyst to reject the entity with a 400 error. Filter representations[].contents in buildItemEntity after makeContentFiles runs, keeping only files that are present in the final entity content map. This is a defensive fix that covers items already stored with bad data from older builder-client versions. Closes #3388
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coverage Report for CI Build 24846819893Coverage decreased (-0.02%) to 49.792%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
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
buildItemEntity, aftermakeContentFilesproduces the entity content map, filter each representation'scontentsarray to only include files that are actually in the content mapmale/bin/) or 0-byte files (e.g.male/main.crdt) inrepresentations[].contentsfrom olderbuilder-clientversionsRoot Cause
makeContentFiles(incontentUtils.ts) intentionally skips 0-byte blobs when building the entity content payload:However,
buildWearableEntityMetadatacopiesitem.data.representationsas-is, without applying the same filter. This creates a mismatch: the Catalyst content-validator sees files listed inrepresentation.contentsthat are absent from the entity content, and rejects the deploy with:Removing the failing entry just moves the error to the next 0-byte or directory entry.
Fix
In
buildItemEntity, aftermakeContentFilescompletes, build the set of valid content files and strip any entries inrepresentations[].contentsthat are not in that set:Changes
src/modules/item/export.ts: filterrepresentations[].contentsinbuildItemEntityto match the actual entity content payloadWhy this is needed even after fixing builder-client
The upstream fix in
decentraland/builder-client(PR #80) prevents directory entries and 0-byte files from being stored in new items going forward. But items already stored in the Builder API with these entries in theirrepresentations[].contentswill continue to fail on every curator deploy without this defensive fix.Closes
#3388
🤖 Created via Slack with Claude
Requested by Rocío Corral Mena via Slack