Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/upload-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { toFile } from '../internal/to-file';
import { multipartFormRequestOptions } from '../internal/uploads';
import type { Fetch } from '../internal/builtin-types';

const DEFAULT_THRESHOLD = 100 * 1024 * 1024; // 100MB
const DEFAULT_THRESHOLD = 10 * 1024 * 1024; // 10MB
const DEFAULT_CONCURRENCY = 5;
const DEFAULT_PART_SIZE = 100 * 1024 * 1024; // 100MB per part
const MIN_PART_SIZE = 5 * 1024 * 1024; // 5MB minimum
const MIN_PART_SIZE = 1 * 1024 * 1024; // 1MB minimum

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Error messages hardcode "5MB" but minimum is now 1MB

Medium Severity

Changing MIN_PART_SIZE to 1MB without updating the hardcoded "5MB" in the error messages on lines 75 and 79 produces contradictory output. For example, the error now reads "partSize must be at least 5MB (1048576 bytes)" — but 1048576 bytes is 1MB, not 5MB. The human-readable label and the interpolated byte value disagree, confusing users.

Additional Locations (2)
Fix in Cursor Fix in Web

const MAX_PART_COUNT = 10_000;

export interface PartUploadEvent {
Expand Down
Loading