fix(marketplace): surface archive failures#367
Conversation
Greptile SummaryThis PR fixes a silent-failure bug in the Archive action across all three marketplace listing forms (skill, MCP, prompt): previously, non-2xx responses and network errors were swallowed entirely, leaving the button stuck in a loading state and the user with no feedback. The fix surfaces API error messages, clears stale errors before each attempt, and uses a
Confidence Score: 5/5Safe to merge — the change is a targeted, well-tested improvement to error handling that does not affect happy-path data flow. All three forms receive an identical, mechanically correct fix: the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([User clicks Archive]) --> B{confirm dialog}
B -- cancelled --> Z([Return, no change])
B -- confirmed --> C[setDeleting true\nsetError null]
C --> D[fetch DELETE /api/resource/slug]
D -- network error --> E[catch: setError fallback message]
E --> F[finally: setDeleting false]
F --> G([Error shown, button re-enabled])
D -- res.ok false --> H[parse res.json\nsetError data.error or fallback]
H --> I[return]
I --> F
D -- res.ok true --> J[router.push dashboard\nrouter.refresh]
J --> K[finally: setDeleting false]
K --> L([Navigate away])
Reviews (1): Last reviewed commit: "fix(marketplace): surface archive failur..." | Re-trigger Greptile |
Summary
Paid task
https://ugig.net/gigs/abd6b2a0-e728-48cf-a46f-f99e419ed94e
Verification
pnpm exec vitest run src/components/MarketplaceListingArchive.test.tsxpnpm exec eslint src/components/skills/SkillListingForm.tsx src/components/mcp/McpListingForm.tsx src/components/prompts/PromptListingForm.tsx src/components/MarketplaceListingArchive.test.tsxgit diff --check