[codex] show oversized upload toast#8
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 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 |
| const DROPBOX_UPLOAD_LIMIT_MB = 150; | ||
| const DROPBOX_UPLOAD_LIMIT_BYTES = DROPBOX_UPLOAD_LIMIT_MB * 1024 * 1024; |
There was a problem hiding this comment.
🚩 Upload limit uses binary MiB instead of decimal MB
The limit is calculated as 150 * 1024 * 1024 (157,286,400 bytes) at src/index.ts:23, but the Dropbox /2/files/upload API documents its limit as 150 MB. If Dropbox means decimal megabytes (150,000,000 bytes), files between ~150 MB and ~157 MB would pass the client-side check but still fail server-side. Since the server error path already handles failures gracefully (catchError at src/index.ts:289), the impact is limited to a less-helpful error message for that narrow range. Worth confirming against Dropbox's actual byte threshold.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Adds a client-side 150 MB size guard before sending files to Dropbox. Oversized files now show a dedicated danger toast explaining that this uploader currently supports files up to 150 MB.
Why
The current uploader uses Dropbox's single
/2/files/uploadendpoint, which rejects payloads larger than 150 MB. Without a local check, users wait for Dropbox to fail and see the generic upload failure message.Impact
Users get immediate, specific feedback when a file is too large. The guard also avoids reading oversized files into memory before the request.
Validation
npm run build:roampassed withsrc built with 0 errors.npx tsc --noEmit -p tsconfig.jsonstill fails on existingsrc/mimeTypes.tsundefined checks unrelated to this change.