feat(presigned-url): enforce bulk upload limits (maxBulkFiles + maxBulkTotalSize)#1081
Merged
Merged
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Adds enforcement of
maxBulkFilesandmaxBulkTotalSizelimits to the bulk file upload mutation (uploadAppFiles,uploadDataRoomFiles, etc.). Previously, these config values were loaded fromstorage_module(with defaults of 100 files / 1GB) but never actually checked — the bulk mutation would process any number of files unconditionally.Now, before the file processing loop, the mutation validates:
storageConfig.maxBulkFiles→ throwsBULK_UPLOAD_FILES_EXCEEDEDstorageConfig.maxBulkTotalSize→ throwsBULK_UPLOAD_SIZE_EXCEEDEDThis is Step 1 of the bulk upload limits plan (#794). Step 2 will wire in
resolve_cap()from the limits module for per-org overrides.Review & Testing Checklist for Human
f.size || 0fallback is acceptable: If a file entry hassize: 0orsize: undefined, it contributes 0 bytes to the total. Individual files will still fail inprocessSingleFile(which requiressize > 0), but the batch-level size check would pass. Confirm this fail-later behavior is fine, or if the batch check should also reject files with missing/zero size.s3-signing.test.tssuite or theminio-multi-scope.integration.test.tsin constructive-db to verify rejection at the limit boundary.Notes
maxBulkFilesandmaxBulkTotalSizevalues are already configurable per-database via thestorage_moduletable columnsmax_bulk_filesandmax_bulk_total_size, with plugin defaults of 100 and 1GB respectively.Link to Devin session: https://app.devin.ai/sessions/7903d2a3e7a34c6daa605e12d6b80d9e
Requested by: @pyramation