Skip to content

fix(upload): bound the proxy body buffer to one upload request; give the update check 30 s - #326

Closed
RoyaLemonade wants to merge 2 commits into
ompweb-dev:mainfrom
RoyaLemonade:pr/upload-update-check
Closed

RoyaLemonade wants to merge 2 commits into
ompweb-dev:mainfrom
RoyaLemonade:pr/upload-update-check

Conversation

@RoyaLemonade

Copy link
Copy Markdown
Contributor
  • Uploads larger than 10 MB failed with 500 "Failed to parse body as FormData." because Next's
    experimental.proxyClientMaxBodySize defaults to 10 MB and the proxy buffers every request body
    before it can answer 401. The limit now covers exactly one upload request (the route's 25 MB
    per-file cap plus 1 MiB of multipart framing) and is derived from shared constants in
    lib/upload-limits.ts, so it cannot grow with the selection. The web uploader sends a larger
    selection as batches of at most one request's worth (batchUploadFiles), so a 100 MB selection
    still uploads - as several requests - and the route's own 25 MB/100 MB checks stay authoritative
    and answer a clean 413 inside the buffer. A contract test keeps the proxy limit, the route's
    checks, the uploader and the constants in lockstep.
  • omp update --check takes ~18 s on a cold start (Node CLI startup plus network); the 15 s timeout
    made Settings show "The OMP update could not be started". Raised to 30 s.

Tests: lib/upload-limits.test.mjs, lib/api-contract.test.mjs.

Context: the native Android client (separate PR to follow) uploads files through the same route and
was the reason this showed up; nothing in this PR is Android-specific.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0eed0be0-379a-4b2b-b3d1-172b3ecb1982
Commits

Reviewing files that changed from the base of the PR and between 1317bf3 and bf9e1a8.

Files selected for processing: 9
  • CHANGELOG.md
  • app/api/files/[...path]/route.ts
  • components/FileExplorer.tsx
  • lib/api-contract.test.mjs
  • lib/image-attachments.ts
  • lib/omp/updates.ts
  • lib/upload-limits.test.mjs
  • lib/upload-limits.ts
  • next.config.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kilo-code-bot

kilo-code-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Code Review Roast 🔥

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything.

📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are.

Files Reviewed (9 files)
  • CHANGELOG.md
  • app/api/files/[...path]/route.ts
  • components/FileExplorer.tsx
  • lib/api-contract.test.mjs
  • lib/image-attachments.ts
  • lib/omp/updates.ts
  • lib/upload-limits.test.mjs
  • lib/upload-limits.ts
  • next.config.ts

Reviewed by free · Input: 50.9K · Output: 2K · Cached: 192.5K

@kahme247 kahme247 added the needs rebase Rebase onto current main; needs re-review label Nov 5, 2026
@kahme247

kahme247 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

The Bun server/daemon architecture has landed on main, so this PR needs to be rebased and re-reviewed against the new architecture before it can be merged. Please rebase onto current main, resolve the conflicts, and request re-review once CI is green.

@RoyaLemonade

Copy link
Copy Markdown
Contributor Author

Superseded by #411, which carries the same change as a Bun-server PR against current main (this branch was written for the Next.js server and no longer applies).

The new PR keeps the scope of this one, with its own tests and a description of what changed. Closing this in favour of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Rebase onto current main; needs re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants