feat(frontend): add App Router error boundaries and diagnostic error handling - #483
feat(frontend): add App Router error boundaries and diagnostic error handling#483samueldoo wants to merge 4 commits into
Conversation
- Add comprehensive OpenAPI 3.1 spec covering all routes in registry.js, agents.js, services.js, and demo.js - Serve OpenAPI spec at /openapi.json endpoint - Add contract tests to validate API responses against OpenAPI spec - Install @apidevtools/swagger-parser for spec validation - Document all request/response schemas with proper types and validation
- Add url-validator.js with comprehensive URL validation - Block non-HTTPS endpoints - Block private, loopback, and link-local IP addresses (IPv4 and IPv6) - Resolve DNS and block endpoints that resolve to private IPs - Add configurable ALLOWED_ENDPOINTS allowlist for local development - Validate redirects to prevent SSRF via redirect chains - Integrate validation into agent.js HTTP client - Add comprehensive test suite covering SSRF attack scenarios - Tests cover AWS metadata service, localhost, and DNS rebinding attacks
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@samueldoo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Hi @samueldoo, This PR could not be merged because it has merge conflicts with the target branch. Please resolve the merge conflicts, push the updated changes, and the PR can be reviewed and merged. Thank you! |
Closes #376
Summary
This PR adds error boundaries across the Next.js App Router tree in
frontend/app/to prevent blank screens or unstyled default error screens when contract reads, RPC requests, or component renders fail.Key Changes
Root Error Boundary (
app/error.tsx):#FAFAF7, error badges, card styling).reset()to re-attempt rendering/fetches.console.errorfor diagnostic monitoring.Route-Level Error Boundaries:
app/registry/error.tsx: Tailored for Soroban contract read failures on the service registry.app/agents/error.tsx: Tailored for agent credit score fetch failures.app/services/error.tsx: Tailored for service details fetch failures.app/global-error.tsx: Handles root layout shell failures.Unit Tests (
__tests__/ErrorBoundaries.test.tsx):console.error, and invokereset()on retry.Verification
npx next build— compiled all 11 routes cleanly.npx jest— all 17 test suites (49 total tests) passed.