[BR-2181]:fix/show toast instead of storage-full dialog on rate-limited uploads#2032
Open
jaaaaavier wants to merge 3 commits into
Open
[BR-2181]:fix/show toast instead of storage-full dialog on rate-limited uploads#2032jaaaaavier wants to merge 3 commits into
jaaaaavier wants to merge 3 commits into
Conversation
Deploying drive-web with
|
| Latest commit: |
c518815
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://08f16305.drive-web.pages.dev |
| Branch Preview URL: | https://fix-false-storage-full-notif.drive-web.pages.dev |
|
larryrider
approved these changes
Jul 9, 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.



Description
The purpose of this PR is to fix a bug where a user would receive a 420 error (too many requests) when uploading a file, and the app would display ReachedPlanLimitDialog, when in reality the user had plenty of available space.
In UploadManager.ts, any error with status === 420 was always treated as "out of space" by directly invoking maxSpaceOccupiedCallback. However, the 420 status code is also used for rate limiting (e.g., when a user is backing up data with the desktop app while simultaneously uploading via the web), so the dialog was triggered incorrectly.
Fix
In uploadItemsThunk.ts, notifyMaxSpaceOccupied is added, replacing the previous callback in uploadItemsThunk and uploadItemsParallelThunk. Before deciding whether to open the dialog, it checks the plan's actual usage against its limit using planSelectors.planLimitToShow / planUsageToShow:
If the user truly has no space left (planUsage >= planLimit), the current behavior is kept and ReachedPlanLimitDialog is opened.
If the user does have available space, the dialog is not opened. The error still flows through the existing generic error handling in the thunk, which already shows a toast with the server's error message — so the user isn't left without feedback, they just no longer see the incorrect "storage is full" message.
Incidentally, isUploadAllowed (the pre-upload check) has been refactored to use the same selectors instead of duplicating the manual planLimit/planUsage calculation per workspace.
Two tests were added to uploadItemsThunk.test.ts covering both branches: the dialog is not opened when the account still has available space, and it is opened when the account has actually run out of storage.
Related Issues
Related Pull Requests
Checklist
Testing Process
420(status: 420) directly at the network entry point used by the worker (uploadFileinsrc/app/network/upload.ts), which is the exact call path thatUploadManager.tsreacts to (handleUploadErrors→maxSpaceOccupiedCallback).ReachedPlanLimitDialogis not opened; the upload error still surfaces through the existing generic error toast.Additional Notes