Skip to content

[codex] show oversized upload toast#8

Merged
mdroidian merged 1 commit into
mainfrom
codex/show-oversized-upload-toast
Jun 26, 2026
Merged

[codex] show oversized upload toast#8
mdroidian merged 1 commit into
mainfrom
codex/show-oversized-upload-toast

Conversation

@mdroidian

Copy link
Copy Markdown
Contributor

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/upload endpoint, 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:roam passed with src built with 0 errors.
  • npx tsc --noEmit -p tsconfig.json still fails on existing src/mimeTypes.ts undefined checks unrelated to this change.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0cf9058d-40ac-48d9-afc7-4a07c1af4c23

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@mdroidian mdroidian marked this pull request as ready for review June 26, 2026 17:51
@mdroidian mdroidian merged commit dff3bc4 into main Jun 26, 2026
2 checks passed
@mdroidian mdroidian deleted the codex/show-oversized-upload-toast branch June 26, 2026 17:51

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread src/index.ts
Comment on lines +22 to +23
const DROPBOX_UPLOAD_LIMIT_MB = 150;
const DROPBOX_UPLOAD_LIMIT_BYTES = DROPBOX_UPLOAD_LIMIT_MB * 1024 * 1024;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant