Repository navigation
Conversation
On the classic path, only the original upload is checked against the site's upload space. The image editor then writes sub-sizes even when the original used the last of it. With client-side media processing, every sub-size is sideloaded and checked against the quota on its own, so it is rejected with "Not enough space to upload." and the attachment is left with missing sub-sizes, or deleted when they all fail. The first test is the classic baseline and passes. The second fails until the sideload endpoint stops checking the quota for an attachment's own sub-sizes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Adds two multisite tests showing that client-side media processing checks each sub-size against the site's upload space quota, while the classic path only checks the original.
test_server_sub_sizes_after_multisite_upload_space_is_used()(passes): the original is uploaded while there is space left, the quota is then set to zero, andwp_update_image_subsizes()still writes the thumbnail.test_sideload_sub_size_after_multisite_upload_space_is_used()(fails): the same situation, but the thumbnail is sideloaded as the browser would, andcheck_upload_size()rejects it:On a site close to its quota, this can leave an attachment with missing sub-sizes that the classic path would have generated.
The tests are tagged
ms-required. To run them:npm run test:php -- -c tests/phpunit/multisite.xml --filter after_multisite_upload_space_is_usedTests only, no fix yet. The failing test assumes the sideload should match the classic path. It is also reasonable to argue that the quota check is correct and the classic path is the lenient one. In that case, the test should expect the rejection, along with a clear error and no half-processed attachment.
Trac ticket: TBD
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Investigating the issue while reviewing #15512, and drafting the tests and this description. To be reviewed by me.
🤖 Generated with Claude Code
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.