Skip to content

fix: check response.ok when saving variant storage setting#485

Merged
Zheaoli merged 1 commit into
mainfrom
fix/variant-storage-save-ok
May 30, 2026
Merged

fix: check response.ok when saving variant storage setting#485
Zheaoli merged 1 commit into
mainfrom
fix/variant-storage-save-ok

Conversation

@Zheaoli

@Zheaoli Zheaoli commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

Post-merge review of #483 (raised by both @Picimpact-Design design review and @Picimpact-Review code review): variant-storage-card.tsx's save() did await fetch(PUT) then always toasted success. fetch doesn't reject on 4xx/5xx, so a failed PUT wrongly reports success — and for this setting that's especially misleading: the admin believes they selected S3/R2 while variant_storage stays empty, variantBaseUrl is blank, and the backfill can't run.

Fix

Capture the response and throw on !res.ok so it routes to the existing Config.updateFailed toast.

Verification

pnpm lint — 0 errors. npx tsc --noEmit — no errors in variant-storage-card.tsx.

🤖 Generated with Claude Code

fetch() doesn't reject on HTTP 4xx/5xx, so a failed PUT to
/api/v1/settings/variant-storage would still toast "success". For this setting
that's especially misleading: the admin thinks they selected S3/R2 while
variant_storage stays empty, variantBaseUrl is blank, and backfill can't run.
Throw on !res.ok so it routes to the updateFailed toast.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented May 30, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
picimpact Ready Ready Preview, Comment May 30, 2026 12:15pm

@Zheaoli Zheaoli merged commit 37ea124 into main May 30, 2026
6 checks passed
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