Fix direct upload size limit validation and quota refresh - #12706
Open
sriramkanakam87 wants to merge 4 commits into
Open
sriramkanakam87 wants to merge 4 commits into
sriramkanakam87 wants to merge 4 commits into
Conversation
…QSS#12645 Delete files uploaded directly to S3 when post-upload validation fails and return the corresponding validation error to the user.
Validate files against upload-size and remaining-quota limits before direct upload. Refresh the available quota after uploads and unsaved-file deletions, and reinitialize direct upload after AJAX updates.
Cover current and fallback upload quota values, including their human-readable representation. Verify that deleting an unsaved file removes its temporary state and restores the available upload quota.
Member
|
@sriramkanakam87 thanks for the pull request! ❤️ We discussed in just now during our Triage Tuesday meeting, sized it, and moved it into "ready for review" on our project board. |
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 this PR does / why we need it:
This PR improves storage quota and file-size validation for direct uploads.
Files are validated before they enter the direct-upload queue, preventing files that exceed the per-file size limit or remaining storage quota from being uploaded unnecessarily. It also ensures that the current remaining quota is used after AJAX updates and restores quota when an unsaved uploaded file is deleted.
The upload widget and displayed quota are refreshed after uploads and deletions. A redundant warning icon added by PrimeFaces is removed while retaining the existing dismiss button.
Which issue(s) this PR closes:
Special notes for your reviewer:
The changes apply specifically to the direct-upload workflow. Existing server-side validation remains in place to make sure limits are checked during parallel uploads from multiple users.
The upload widget needed reinitializing after PrimeFaces replaces it through an AJAX update. The updated callbacks pass the latest remaining quota when doing so.
Suggestions on how to test this:
The unit tests can be run with:
mvn -Dtest=EditDatafilesPageTest test
These cover server-side quota handling, but the browser side UI sequence described above.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Yes. Invalid direct uploads now show a warning before uploading, and the displayed remaining quota refreshes after uploads and deletion of unsaved files. This is a behavioral adjustment to the existing upload interface rather than a layout change, so no mockup is required.
Is there a release notes update needed for this change?:
Yes. A short release note is recommended because this fixes user-visible direct-upload validation and quota-refresh behavior.
Additional documentation:
None