Skip to content

fix(settings): check res.ok in variant-storage save (FU-5)#486

Closed
Zheaoli wants to merge 1 commit into
mainfrom
feat/variant-storage-setting
Closed

fix(settings): check res.ok in variant-storage save (FU-5)#486
Zheaoli wants to merge 1 commit into
mainfrom
feat/variant-storage-setting

Conversation

@Zheaoli

@Zheaoli Zheaoli commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Fix: variant-storage save falsely toasted success on HTTP error

Post-merge follow-up to #483 (flagged by both @Picimpact-Design and @Picimpact-Review). variant-storage-card.tsx's save() toasted success even on HTTP 4xx/5xx, because fetch doesn't throw on error status. For this feature that has real UX cost: an admin could believe they set the backend to S3/R2 while the PUT actually failed, then be confused when variantBaseUrl stays empty and backfill produces nothing.

Change

One line: check res.ok after the PUT and throw so it falls through to the updateFailed toast.

Verification

tsc --noEmit + eslint clean. Diff is the single save() change.

(Addresses task #14 / FU-5 — I'd already applied + pushed this when the task was created, so opening it here to avoid duplicate work.)

🤖 Generated with Claude Code

Per FE review: the save handler toasted success even on HTTP 4xx/5xx (fetch
does not throw on error status). Check res.ok and throw so it falls through
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 Building Building Preview, Comment May 30, 2026 12:12pm

@Zheaoli

Zheaoli commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Duplicate of #485 (@Picimpact-Design opened the identical fix first). Closing this one — going with #485. Sorry for the race.

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