clean: Fix React hooks violation in onboarding#1204
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR replaces OpenAI-specific retry error handling with a generic AI quota error detection mechanism. Changes span error type definitions, error message mappings, detection logic, and error handling in settings and LLM utilities, alongside minor updates to the onboarding page for Suspense support. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
🧰 Additional context used📓 Path-based instructions (23)**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
Files:
apps/web/app/(app)/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Files:
apps/web/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Files:
**/*.{tsx,ts}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{tsx,ts,css}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
**/*.{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
!(pages/_document).{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
Files:
apps/web/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/app/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/**/*.{tsx,jsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/**/*.{ts,tsx,js,jsx,json,css}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/utils/actions/*.ts📄 CodeRabbit inference engine (.cursor/rules/fullstack-workflow.mdc)
Files:
apps/web/utils/actions/**/*.ts📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Files:
**/*.ts📄 CodeRabbit inference engine (.cursor/rules/security.mdc)
Files:
**/{utils,helpers,lib}/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)
Files:
apps/web/utils/actions/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/**/*.{example,ts,json}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/{utils/ai,utils/llms,__tests__}/**/*.ts📄 CodeRabbit inference engine (.cursor/rules/llm.mdc)
Files:
apps/web/utils/llms/{index,model}.ts📄 CodeRabbit inference engine (.cursor/rules/llm.mdc)
Files:
🧠 Learnings (24)📓 Common learnings📚 Learning: 2025-06-05T09:49:12.168ZApplied to files:
📚 Learning: 2025-07-08T13:14:07.449ZApplied to files:
📚 Learning: 2025-08-10T22:03:30.507ZApplied to files:
📚 Learning: 2025-11-25T14:40:15.063ZApplied to files:
📚 Learning: 2025-11-25T14:37:09.306ZApplied to files:
📚 Learning: 2025-12-21T12:21:37.794ZApplied to files:
📚 Learning: 2025-11-25T14:40:13.649ZApplied to files:
📚 Learning: 2025-11-25T14:39:23.326ZApplied to files:
📚 Learning: 2025-11-25T14:39:08.150ZApplied to files:
📚 Learning: 2025-11-25T14:39:49.448ZApplied to files:
📚 Learning: 2025-11-25T14:39:27.909ZApplied to files:
📚 Learning: 2025-11-25T14:38:07.606ZApplied to files:
📚 Learning: 2025-11-25T14:38:07.606ZApplied to files:
📚 Learning: 2025-11-25T14:38:07.606ZApplied to files:
📚 Learning: 2025-11-25T14:39:23.326ZApplied to files:
📚 Learning: 2025-11-25T14:38:07.606ZApplied to files:
📚 Learning: 2025-11-25T14:39:08.150ZApplied to files:
📚 Learning: 2025-11-25T14:39:27.909ZApplied to files:
📚 Learning: 2025-12-21T12:21:37.794ZApplied to files:
📚 Learning: 2025-11-25T14:39:27.909ZApplied to files:
📚 Learning: 2025-11-25T14:38:07.606ZApplied to files:
📚 Learning: 2025-11-25T14:38:07.606ZApplied to files:
📚 Learning: 2025-11-25T14:38:07.606ZApplied to files:
🧬 Code graph analysis (2)apps/web/utils/actions/settings.ts (1)
apps/web/utils/llms/index.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (6)
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 |
Render onboarding step content in
|
User description
This PR fixes a 'Rendered more hooks than during the previous render' error on the clean onboarding route by adding a Suspense boundary and using a unique key for each step.
Generated description
Below is a concise technical summary of the changes proposed in this PR:
graph LR handleError_("handleError"):::modified isAiQuotaExceededError_("isAiQuotaExceededError"):::added ErrorType_("ErrorType"):::modified isKnownApiError_("isKnownApiError"):::modified checkCommonErrors_("checkCommonErrors"):::modified updateUserSettingsNotifications_settings_action_list_("updateUserSettingsNotifications (settings action list)"):::modified isAnthropicInsufficientBalanceError_("isAnthropicInsufficientBalanceError"):::modified handleError_ -- "Now detects AI quota errors and notifies with AI_QUOTA_ERROR." --> isAiQuotaExceededError_ handleError_ -- "Uses new ErrorType.AI_QUOTA_ERROR for rate-limit notifications." --> ErrorType_ isKnownApiError_ -- "Treats AI quota RetryError instances as known API errors." --> isAiQuotaExceededError_ checkCommonErrors_ -- "Recognizes AI quota errors and returns standardized 429 response." --> isAiQuotaExceededError_ updateUserSettingsNotifications_settings_action_list_ -- "Includes AI_QUOTA_ERROR in settings notification action list." --> ErrorType_ isKnownApiError_ -- "Continues to detect Anthropic insufficient balance as known error." --> isAnthropicInsufficientBalanceError_ classDef added stroke:#15AA7A classDef removed stroke:#CD5270 classDef modified stroke:#EDAC4C linkStyle default stroke:#CBD5E1,font-size:13pxResolves a React hooks violation in the clean onboarding flow by introducing a
Suspenseboundary with a unique key for each step, and refactors AI quota error handling to be more generic across different AI providers.Suspenseboundary with a unique key for each step and awaitingsearchParamsearlier inpage.tsx.Modified files (1)
Latest Contributors(2)
OPENAI_RETRY_ERRORtoAI_QUOTA_ERRORand expanding the detection logic for rate limiting across various AI providers.Modified files (4)
Latest Contributors(2)
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Updates
✏️ Tip: You can customize this high-level summary in your review settings.