Skip to content

Say where the upload size ceiling actually is - #189

Open
renrenmimi wants to merge 1 commit into
mainfrom
fix/media-size-limit-comment
Open

Say where the upload size ceiling actually is#189
renrenmimi wants to merge 1 commit into
mainfrom
fix/media-size-limit-comment

Conversation

@renrenmimi

Copy link
Copy Markdown
Owner

The comment I left in #187 was still wrong — just wrong in a new direction. It said the enforceable limit lived in the petnote_image_signed / petnote_video_signed upload presets.

The owner checked the Cloudinary console: a preset has no max-file-size setting at all, across all six tabs. That absence is precisely why the parameter was silently ignored and the signature could never match.

Where the ceiling actually is

enforces a size limit?
Account plan Yes. Cloudinary rejects anything over it regardless of what we send. Free tier: 10 MB image, 100 MB video.
Upload preset No such setting exists.
Signature No — and this is the part that bit us.

So a server-side ceiling has existed all along. It's enforced by the platform rather than by us, which is a different claim from either comment this file has carried. Our constants were chosen to match it: the image number is the plan limit, the video number is deliberately stricter (80 MB against the plan's 100 MB).

Why the comment gets this much space

A wrong comment in this exact spot caused a production outage. The first version promised a guarantee Cloudinary doesn't offer; someone implemented it, and every upload broke. My replacement pointed at a setting that turns out not to exist, which would have sent the next person hunting through a console for it.

It's now written as the table above — plan, preset, signature — so the options are visible at a glance rather than reasoned back to from a claim. And it ends with the rule stated outright: the signature proves the request came from us, it cannot constrain the upload. If a tighter limit is ever needed, it has to be enforced after the fact by inspecting and deleting the asset, not before.

Comment only, no behaviour change. build and lint clean.

🤖 Generated with Claude Code

The comment I left in #187 was still wrong, just wrong in a new direction. It
said the enforceable limit lived in the petnote_image_signed /
petnote_video_signed upload presets. The owner checked the Cloudinary console:
a preset has no max-file-size setting at all, across all six tabs. That absence
is precisely why the parameter was silently ignored and the signature could
never match.

The real ceiling is the account plan. Cloudinary rejects anything over it
regardless of what we send — on the free tier, 10 MB for images and 100 MB for
video. The constants here were chosen to match it: the image number IS the plan
limit, and the video number is deliberately stricter.

So a server-side ceiling has existed all along. It is just enforced by the
platform rather than by us, which is a different claim from either comment this
file has carried.

Written as a table of where a limit can and cannot be enforced — plan, preset,
signature — so the next person can see at a glance that the signature is not an
option, rather than reasoning their way back to the bug. Ends with the rule
outright: the signature proves the request came from us, it cannot constrain
the upload.

Comment only; no behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 6, 2026 22:09

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pet-note Ready Ready Preview Sep 6, 2026 10:09pm UTC

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74434c4e5d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread functions/src/media.ts
Comment on lines +51 to +52
// So: do not add parameters to the signature to enforce anything. The
// signature proves the request came from us; it cannot constrain the upload.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit the warning to unsupported size parameters

When a future upload control uses a supported Cloudinary parameter, this instruction would incorrectly discourage signing it. A signature binds the recognized request parameters—this function already relies on that behavior to constrain folder and upload_preset—so only the unsupported max_file_size parameter cannot provide the desired limit. Revise the comment to distinguish that parameter from supported signable upload options.

Useful? React with 👍 / 👎.

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.

2 participants