Feat/pb 6335 file size limit validation#376
Open
AlexisMora wants to merge 6 commits into
Open
Conversation
Base automatically changed from
feat/pb-6335-frontend-pre-validation-limits
to
main
June 5, 2026 08:39
egalvis27
requested changes
Jun 5, 2026
Comment on lines
+23
to
+24
| vi.restoreAllMocks(); | ||
| vi.clearAllMocks(); |
There was a problem hiding this comment.
Remember, you don't need to do this. It's already done automatically.
|
|
||
| beforeEach(() => { | ||
| vi.restoreAllMocks(); | ||
| vi.clearAllMocks(); |
There was a problem hiding this comment.
Remember, you don't need to do this. It's already done automatically.
| const stopWatching = vi.fn(); | ||
|
|
||
| beforeEach(() => { | ||
| vi.resetAllMocks(); |
There was a problem hiding this comment.
Remember, you don't need to do this. It's already done automatically.
|
|
||
| afterEach(() => { | ||
| clearMaxFileSizeRejectionModal(); | ||
| vi.clearAllMocks(); |
There was a problem hiding this comment.
Remember, you don't need to do this. It's already done automatically.
|
egalvis27
approved these changes
Jun 5, 2026
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 is Changed / Added
This pull request implements upload file-size enforcement using per-file validation for uploads and backups.
For the upload into the virtual drive, the app now validates writes using the projected logical file size, calculated from the current temporal size, write offset, and incoming chunk length. This is needed because FUSE writes are chunk-based and may be sequential, sparse, or out of order. The app does not reliably know the source path or final source size upfront.
If the projected size exceeds the known user plan limit or the absolute 100GB upload cap, the write is rejected with
EFBIG. The path is marked as blocked so later writes/releases for the same file do not continue uploading a partial temporal file. In this scenario, nautilus will also show a native modal stating that the given file is too big.Added a mechanism for rejection aggegation to determine if the user is uploading a single or multiple files that have been rejected, so we know if we need to show the single or multiple file varian of the modal
Added backend 402 handling as
FILE_TOO_BIGin create/override operations both in the virtual drive and backupsFILE_TOO_BIGis treated as non-retryable.Added fallback handling for the case where both api and local plan limit is not available. In that case, local validation still enforces the absolute 100GB cap, but plan-limit enforcement relies on the backend. If the backend rejects virtual-drive metadata creation/override with
FILE_TOO_BIG, the temporal file is copied into a durable recovery folder while preserving the original virtual path structure:Example:
/photos/a/b/c/photo.jpgis recovered as:~/.config/internxt/rejected-files-size-too-big/photos/a/b/c/photo.jpgIf the recovered path already exists, the file is saved as photo
(copy 1).jpg, and later falls back to a timestamp/random suffix if needed.For Backups the files that exceed the file size limit will just be skipped.
Why
The app needs to enforce upload size limits without losing user data during drag/drop, copy/paste, cut/paste, folder copies, backup uploads, and similar flows.
FUSE does not provide a reliable “this folder/file is about to be uploaded with this source path and final size” event. The reliable point for local virtual-drive enforcement is during write, using the projected resulting file size.
The preservation of the data is a priority in this case specially when relying on backend validation, even though nautilus by default does not "remove" origin even when cut or drag and drop on folders (thats not the case for files) I have decided to preserve the data locally in a separate file so the files that tried to be uploaded are still recoverable in the case that nautilus ever changes this behaviour.