fix: timeout error on org creation#308
Conversation
- Added `addCommentAction` for server-side comment creation with validation using Zod. - Introduced `Comments` component for displaying and adding comments in various pages. - Updated relevant pages (Policy, Risk, Vendor) to include comments functionality. - Created `CreateCommentForm` for user input and submission of comments. - Added database schema for `Comment` and updated related models in Prisma. - Ensured comments are fetched and displayed correctly in the UI.
- Wrapped comments fetching logic in try-catch blocks across Policy, Risk, and Vendor pages to improve error handling. - Ensured that errors are logged and an empty array is returned in case of failure, maintaining UI stability.
- Reformatted metadata and viewport properties in layout files for both app and portal to enhance readability and maintainability. - Ensured consistent structure across metadata definitions, including Twitter and Open Graph settings. - Updated layout component structure for improved clarity in rendering logic.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces a comprehensive commenting feature. It adds a new backend action to create comments with proper validation of user sessions and organization membership, along with a corresponding schema. Frontend pages including policies, risks, and vendors are updated to fetch and display comments. New React components for displaying and creating comments are added. In addition, a database migration and corresponding Prisma schema updates support a new Comment model and its associations. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant CF as CreateCommentForm
participant AC as addCommentAction
participant DB as Database
U->>CF: Fill and submit comment form
CF->>AC: Call addCommentAction({ content, entityId })
AC->>AC: Validate session, organization, and member
AC->>DB: Insert new comment record
DB-->>AC: Return success response
AC->>CF: Send success status (trigger revalidation if needed)
CF->>U: Display confirmation and update UI
sequenceDiagram
participant U as User
participant P as PolicyDetails Page
participant GC as getComments
participant DB as Database
participant C as Comments Component
U->>P: Request policy details
P->>GC: Fetch comments for policyId
GC->>DB: Query comments from Comment table
DB-->>GC: Return comments list
GC-->>P: Deliver comments data
P->>C: Render comments in UI
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (15)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
we had maxDuration = 5 on the root layout... :(
Summary by CodeRabbit