Tighten built-in upload metadata file validation#361
Merged
Conversation
Hold missing or empty attachment metadata file fields as built-in WordPress upload conflicts and refresh release-gate evidence for v0.1.41.
Merged
adamziel
added a commit
that referenced
this pull request
May 18, 2026
## Release `v0.1.42` Version bump for `v0.1.42`. **Changelog draft:** * Tighten built-in upload metadata file validation (#361) * Validate built-in attachment image metadata shape (#362) **Full changelog:** v0.1.41...release/v0.1.42 ## Verification * `git diff --check` * `cargo metadata --no-deps --format-version 1` ## Next steps Merging this PR prepares the release commit. Tagging the merged trunk commit as `v0.1.42` will run the release workflow and publish binaries. Co-authored-by: Codex <codex@openai.com>
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.
What it does
Holds attachments with missing or empty
_wp_attachment_metadata.fileas built-in WordPress upload conflicts. The existing discovered media validator already caught this shape; now the production WordPress-scoped validator reports it directly asplugin-wp-attachment-upload-metadata-file-drift.Also refreshes the merge reliability release-gate evidence from
v0.1.40to the newly publishedv0.1.41release.Rationale
A merged attachment can have
_wp_attached_fileand serialized metadata but still lack the metadata-side original file field. WordPress uses that field when reasoning about media derivatives, so a generic merge should not treat the state as coherent or silently pick a regeneration policy.Implementation
When built-in upload validation sees readable attachment metadata without a usable
filefield, it records a review-only conflict with:field: _wp_attachment_metadata.filerole: metadata-filemetadata_file_presentmetadata_file_wp_attached_filepathTesting instructions