Repository navigation
Sync Community Edition storage, bulk selection, and evolution updates - #241
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 891e4383ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| space.copy_from("personal", space_path(filename), artifact.storage_key, artifact.size_bytes, | ||
| check_quota=False) |
There was a problem hiding this comment.
Keep the quota check and space copy under the same account lock
Two concurrent /v1/file/upload requests can exceed the new My Space quota despite the owner lock. store_bytes_as_artifact() commits by default, releasing lock_folder_owner before the working copy reaches My Space. A second request can therefore measure usage before the first request's copy completes and pass its quota check; both then call copy_from(..., check_quota=False). For example, two 8 MB uploads into an empty space with a 10 MB quota can both succeed. Serialize the usage check through the working-copy write under the same account lock used by other space writes, and test concurrent uploads whose combined size exceeds the quota.
Useful? React with 👍 / 👎.
| const rejected = kind === 'personal' ? storageRejection(files, usage) : null; | ||
| if (rejected) { void message.error(rejected); return; } |
There was a problem hiding this comment.
Account for overwritten files in the upload quota preflight
When uploading over an existing My Space file, this preflight counts the entire incoming file as additional storage and can reject a replacement that the backend correctly permits. With a 100 MB quota and 90 MB used, replacing an existing 20 MB file with another 20 MB file is rejected as needing 20 MB with only 10 MB remaining, although usage would remain 90 MB. The upload loop writes to the existing path, and SpaceFiles._file_target() explicitly subtracts the replaced object's size. Account for replacement sizes in the client check, or defer quota validation to the server when a batch may overwrite existing files.
Useful? React with 👍 / 👎.
Purpose and behavior
Change walkthrough
src/frontend/default.conf.templateandsrc/backend/api/middleware/logging.pyto the file and knowledge upload routes.src/backend/core/auth/capabilities.pyresolves limits, and the space and private knowledge quota modules measure usage.src/frontend/src/components/myspace/SpaceFileBrowser.tsxandDocumentList.tsxrender usage and route selected items through the bulk-delete confirmation. The account capability payload drives the evolution UI and corresponding API checks.Risk and compatibility
Verification
Recovery
Review follow-up