Conversation
Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| private async loadChunkSize(): Promise<void> { | ||
| if (this.chunkSizeLoaded) return; | ||
| try { | ||
| this.chunkSize = (await getUploadConfig()).chunkSizeBytes; | ||
| this.chunkSizeLoaded = true; | ||
| } catch { | ||
| // Retry on the next upload. | ||
| } |
There was a problem hiding this comment.
Concurrent uploads use different chunk sizes
When uploads start together, each worker fetches the chunk setting separately. If one request fails while another succeeds, the first upload uses the 10 MiB fallback even though the server specifies a smaller size. If a proxy limits request bodies below 10 MiB, that upload fails while the other can succeed. Share the in-flight configuration request so the workers use the same result.
Knowledge Base Used: Frontend data and real-time state
| const controller = new AbortController(); | ||
| this.controllers.set(item.uploadId, controller); | ||
|
|
||
| await this.loadChunkSize(); |
There was a problem hiding this comment.
Cancellation waits for configuration
If a user cancels while the configuration request is pending, that request continues and keeps a worker slot occupied. When it finishes, processItem starts the upload flow without checking whether the signal was aborted. The subsequent progress and error updates can replace the upload’s cancelled state and report it as failed.
Knowledge Base Used: Frontend data and real-time state
…s-d9702ac5--chunk-size Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
* Fix auto_discover mounts being dropped at startup (#131) * Fix auto_discover mounts being dropped at startup Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Make the auto_discover test pick a mounted directory and check it is returned Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Make chunk_size_mb control browser upload chunks (#132) * Make chunk_size_mb control browser upload chunks Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Share one chunk size request across upload workers and respect cancel Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Resolve virtual paths in one place (#133) Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Parse WebSocket and job data at the boundary (#134) * Parse WebSocket and job data at the boundary Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Validate job progress range, add parser tests, log rejected frames briefly Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Move frontend state to runes and split the browse page (#136) * Migrate jobs and websocket stores to runes Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Migrate settings store to runes and split out appearance helpers Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Migrate auth store to runes Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Split the browse page into composables Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Keep the WebSocket reconnect backoff when connect runs in an effect Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Fix the auth API docs, drop stale comments, add AGENTS.md (#137) * Fix the auth API docs, drop stale spec comments, add AGENTS.md Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Add the frontend test command to AGENTS.md Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Correct the logout docs and scope the path rule Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Fix --dev failing config validation (#139) * Fix --dev failing config validation Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Isolate the dev credentials test from inherited BoxBox settings Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Test the WebSocket reconnect backoff (#138) * Test the WebSocket reconnect backoff Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Keep the connection mode on WebSocket retries and test the attempt limit Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Fix browsing discovered mount points Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Skip inaccessible auto-discovered mounts Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
Problem
chunk_size_mbis documented as a setting but nothing reads it. The handler stored the value and never used it, and the browser always sent 10 MiB chunks. The default also disagreed with itself: 5 in the config loader, 10 in the code constant, and 5 in the bundledconfig.yaml. An operator behind a proxy with a small request-body limit had no way to shrink upload chunks.Change
GET /api/v1/system/upload, which returns{ "chunkSizeBytes": N }fromchunk_size_mb.chunkSizeoption. Workers that start together share one request, so they use the same size. If the request fails, they keep the 10 MiB fallback and the next upload asks again. An upload cancelled while the request is pending never starts.DefaultChunkSizeMB(10). The bundledconfig.yamlnow says 10, so default deployments keep the chunk size browsers sent before.StreamHandler.docs/api.md,docs/configuration.mdand the changelog.An existing deployment that copied the old
config.yamlwithchunk_size_mb: 5now uploads in 5 MiB chunks. That is the value they set, but it doubles the request count for large files.Verification
go vet ./..., handler, config andcmdtests pass.bun run check,lintandbuildpass.chunk_size_mb: 3.GET /api/v1/system/uploadreturned{"chunkSizeBytes":3145728}with a token and 401 without one.chunk_size_mb: 3, a 8,000,000-byte upload calledGET /api/v1/system/uploadand then sent 3 chunk requests (200, 200, 201). The stored file's SHA-256 matched the source.GET /api/v1/system/upload, and all three stored files matched.GET /system/uploadfails.Stack: 2 of 6. Targets the branch of the PR below it.
Written by anthropic/claude-sonnet-5-5 in the Hoplite agent harness.