Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis PR introduces CORS middleware to the HTTP backend, migrates Prisma client configuration from generated to official package with singleton pattern, fixes a backend URL typo, refactors user routes with enhanced validation and error handling, and adds new Radix UI-based input, label, select, and sheet components to the UI library. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (13)
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 |
There was a problem hiding this comment.
Pull request overview
This PR implements the "Done flow" feature by adding new UI components, fixing backend issues, and updating dependencies. The changes include several new Radix UI components for dialogs, selects, and labels, CORS configuration for the backend, and various bug fixes.
Key changes:
- Added UI components (Sheet, Select, Label, Input) using Radix UI primitives
- Fixed critical BACKEND_URL typo in common package
- Configured CORS middleware in the backend
- Refactored database client imports and Prisma configuration
- Fixed code formatting in node-registry.ts
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Added dependencies for Radix UI components (dialog, select, label), CORS, and related utilities; contains deprecated Next.js version and incorrect react-dialog links |
| packages/ui/src/components/sheet.tsx | New Sheet component using Radix UI dialog primitives for side panel functionality |
| packages/ui/src/components/select.tsx | New Select component with dropdown functionality and scroll controls |
| packages/ui/src/components/label.tsx | New Label component wrapping Radix UI label primitive with consistent styling |
| packages/ui/src/components/input.tsx | New Input component with comprehensive styling and accessibility features |
| packages/ui/package.json | Added Radix UI dependencies and incorrect react-dialog link |
| packages/nodes/src/registry/node-registry.ts | Code formatting improvements (whitespace, semicolons) |
| packages/db/src/index.ts | Changed Prisma import from generated client to @prisma/client; removed Prisma export |
| packages/db/prisma/schema.prisma | Removed custom output path for Prisma client generation |
| packages/common/src/index.ts | Fixed BACKEND_URL from "http:localhost:3002" to "http://localhost:3002" |
| apps/http-backend/tsconfig.tsbuildinfo | Updated file references to reflect corrected casing in route file names |
| apps/http-backend/src/routes/userRoutes/userRoutes.ts | Reformatted routes, added debug logging, and removed user-specific filtering from getAvailableTriggers |
| apps/http-backend/src/index.ts | Added CORS configuration with localhost:3000 as allowed origin |
| apps/http-backend/package.json | Added cors and @types/cors dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }); | ||
| const Data = await prismaClient.availableTrigger.findMany(); | ||
| return res.status(statusCodes.OK).json({ | ||
| message: "Availabe Triggers Fetched Succesfuuly", |
There was a problem hiding this comment.
Typo in log message: "Succesfuuly" should be "Successfully".
| e | ||
| ); | ||
| return res.status(statusCodes.INTERNAL_SERVER_ERROR).json({ | ||
| message: "Internal server error in Createring Triggers", |
There was a problem hiding this comment.
Typo in console log: "Createring" should be "Creating".
| message: "Internal server error in Createring Triggers", | |
| message: "Internal server error in Creating Triggers", |
| userMiddleware, | ||
| async (req: AuthRequest, res: Response) => { | ||
| try { | ||
| console.log("RequestRecieved from the frontend"); |
There was a problem hiding this comment.
Typo in console log: "Recieved" should be "Received".
| console.log("RequestRecieved from the frontend"); | |
| console.log("RequestReceived from the frontend"); |
| react-dialog: | ||
| specifier: link:@types/@radix-ui/react-dialog | ||
| version: link:@types/@radix-ui/react-dialog |
There was a problem hiding this comment.
Duplicate incorrect dependency entry: "react-dialog": "link:@types/@radix-ui/react-dialog". This should be removed or corrected to a valid local path. This is the same issue that appears in the web app's dependencies.
| react-dialog: | |
| specifier: link:@types/@radix-ui/react-dialog | |
| version: link:@types/@radix-ui/react-dialog |
| const Data = await prismaClient.availableTrigger.findMany({ | ||
| where : userId | ||
| }); | ||
| const Data = await prismaClient.availableTrigger.findMany(); |
There was a problem hiding this comment.
The removed where: userId clause has been deleted but was replaced with findMany() without a filter. This change removes user-specific filtering of triggers. If this was intentional (e.g., to return all available triggers instead of user-specific ones), it should be documented. If not, this is a bug that could expose data to unauthorized users.
| const allowedOrigins = ['http://localhost:3000']; | ||
| app.use(cors({ | ||
| origin: allowedOrigins, | ||
| credentials: true, | ||
| })); |
There was a problem hiding this comment.
The CORS configuration only allows 'http://localhost:3000' as an origin. In production environments, this will need to be updated to include the actual production domain(s). Consider using environment variables for the allowed origins to make this configuration more flexible across different environments.
| next@15.4.5: | ||
| resolution: {integrity: sha512-nJ4v+IO9CPmbmcvsPebIoX3Q+S7f6Fu08/dEWu0Ttfa+wVwQRh9epcmsyCPjmL2b8MxC+CkBR97jgDhUUztI3g==} | ||
| engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} | ||
| deprecated: This version has a security vulnerability. Please upgrade to a patched version. See https://nextjs.org/blog/CVE-2025-66478 for more details. |
There was a problem hiding this comment.
The Next.js version 15.4.5 is marked as deprecated due to security vulnerability CVE-2025-66478. This should be upgraded to a patched version as soon as possible to address the security concern.
| next@15.4.5: | |
| resolution: {integrity: sha512-nJ4v+IO9CPmbmcvsPebIoX3Q+S7f6Fu08/dEWu0Ttfa+wVwQRh9epcmsyCPjmL2b8MxC+CkBR97jgDhUUztI3g==} | |
| engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} | |
| deprecated: This version has a security vulnerability. Please upgrade to a patched version. See https://nextjs.org/blog/CVE-2025-66478 for more details. | |
| next@15.4.6: | |
| resolution: {integrity: sha512-REPLACE_WITH_ACTUAL_HASH_FOR_15.4.6} | |
| engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} |
| react-dialog: | ||
| specifier: link:@types/@radix-ui/react-dialog | ||
| version: link:@types/@radix-ui/react-dialog |
There was a problem hiding this comment.
This dependency entry "react-dialog": "link:@types/@radix-ui/react-dialog" appears to be incorrectly configured. The link: protocol should point to a local file path, not to a type definition path. This looks like it should either be removed (since @radix-ui/react-dialog is already a dependency) or corrected to a valid local path.
| react-dialog: | |
| specifier: link:@types/@radix-ui/react-dialog | |
| version: link:@types/@radix-ui/react-dialog |
| "lucide-react": "^0.475.0", | ||
| "next-themes": "^0.4.6", | ||
| "react": "^19.1.1", | ||
| "react-dialog": "link:@types/@radix-ui/react-dialog", |
There was a problem hiding this comment.
The same incorrect dependency "react-dialog": "link:@types/@radix-ui/react-dialog" is added to the package.json. This should be removed entirely, as @radix-ui/react-dialog is already declared as a dependency on line 10.
| "react-dialog": "link:@types/@radix-ui/react-dialog", |
| try { | ||
| const Data = await prismaClient.availableNode.findMany(); | ||
| return res.status(statusCodes.OK).json({ | ||
| message: "Availabe Nodes Fetched Succesfuuly", |
There was a problem hiding this comment.
Typo in log message: "Succesfuuly" should be "Successfully".
| message: "Availabe Nodes Fetched Succesfuuly", | |
| message: "Availabe Nodes Fetched Successfully", |
Summary by CodeRabbit
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.