Skip to content

Fix direct upload size limit validation and quota refresh - #12706

Open
sriramkanakam87 wants to merge 4 commits into
IQSS:developfrom
sriramkanakam87:12007-ui-direct-upload-size-limit-fix
Open

sriramkanakam87 wants to merge 4 commits into
IQSS:developfrom
sriramkanakam87:12007-ui-direct-upload-size-limit-fix

Conversation

@sriramkanakam87

Copy link
Copy Markdown

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:

  1. Configure a dataset to use an S3-compatible store with direct upload enabled.
  2. Enable storage quotas and give the dataset a known amount of remaining storage.
  3. Open the Upload Files page.
  4. Select a file larger than the remaining quota.
  • Confirm that the warning appears before the file is uploaded.
  • Confirm that no file row is added.
  1. Select multiple files whose individual sizes are allowed but whose combined size exceeds the remaining quota.
  • Confirm that the batch is rejected before uploading.
  1. Upload a file that fits within the quota.
  • Confirm that it uploads successfully.
  • Confirm that the displayed remaining quota decreases.
  1. Delete that file without saving the dataset.
  • Confirm that the displayed remaining quota is restored immediately.
  1. Select another file that fits within the restored quota.
  • Confirm that it is accepted.
  1. Repeat the validation using both the file chooser and drag-and-drop.

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

…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.
@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Sep 15, 2026
@pdurbin pdurbin moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Sep 15, 2026
@pdurbin pdurbin added the Size: 10 A percentage of a sprint. 7 hours. label Sep 15, 2026
@pdurbin

pdurbin commented Sep 15, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: 10 A percentage of a sprint. 7 hours.

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

Direct S3 upload through UI ignores collection storage quota precheck and fails silently after upload

2 participants