fix(frontend/marketplace): prevent agent page crash on 404 - #14453
fix(frontend/marketplace): prevent agent page crash on 404#14453seer-by-sentry[bot] wants to merge 1 commit into
Conversation
|
This PR targets the Automatically setting the base branch to |
🔍 PR Overlap DetectionThis check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early. 🔴 Merge Conflicts DetectedThe following PRs have been tested and will have merge conflicts if merged after this PR. Consider coordinating with the authors.
Summary: 1 conflict(s), 0 medium risk, 0 low risk (out of 1 PRs with file overlap) Auto-generated on push. Ignores: |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #14453 +/- ##
==========================================
- Coverage 80.64% 80.64% -0.01%
==========================================
Files 3386 3386
Lines 255966 255976 +10
Branches 23691 23694 +3
==========================================
- Hits 206434 206426 -8
- Misses 44285 44372 +87
+ Partials 5247 5178 -69
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Why / What / How
The agent marketplace page (
/(platform)/marketplace/agent/[creator]/[slug]) previously crashed with anApiErrorwhen attempting to load a non-existent agent. This was due togetV2GetSpecificAgent()being called in bothgenerateMetadata()and the main page component without proper error handling for 404 responses.This PR implements a
try/catchblock around calls togetV2GetSpecificAgent()to gracefully handle 404ApiErrorresponses.If an
ApiErrorwith a 404 status is caught,notFound()fromnext/navigationis called, ensuring the page renders a 404 page instead of crashing. This pattern mirrors the existing robust error handling found in the sibling creator page (/(platform)/marketplace/creator/[creator]/page.tsx).Changes 🏗️
try/catchblocks around calls togetV2GetSpecificAgent()withingenerateMetadata()and the main page component for/(platform)/marketplace/agent/[creator]/[slug].notFound()fromnext/navigationto be called when a 404ApiErroris caught fromgetV2GetSpecificAgent().Checklist 📋
For code changes:
/(platform)/marketplace/agent/[creator]/[slug]with a valid agent slug and confirm the page loads correctly./(platform)/marketplace/agent/[creator]/[slug]with a non-existent agent slug (e.g., a random string) and confirm a 404 page is displayed instead of a crash.generateMetadata()(initial page load) and the main page component (data fetching).Example test plan
For configuration changes:
.env.defaultis updated or already compatible with my changesdocker-compose.ymlis updated or already compatible with my changesExamples of configuration changes
Fixes BUILDER-8X2
This PR was automatically generated by Sentry. You can adjust this setting at any time.