Conversation
VWA57 : Added coverPicture to user entity
…ce-with-rtk-query adding chat feature
…iend-request-service-with-event notify user of new friend request status
HOTFIX : add the user and target data when finding the friendship
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces a complete conversation and messaging system by creating database migrations for conversations, messages, and user participation tracking, establishing corresponding Sequelize models with proper relationships, updating service configurations for conversation and message handling, and refactoring hooks to support state management via date fields instead of boolean flags. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ConvService as Conversation Service
participant MsgService as Message Service
participant DB as Database
participant UserService as User Service
Client->>ConvService: create(direct conversation)
activate ConvService
ConvService->>ConvService: LimitDirectConversations hook
ConvService->>DB: Check for existing conversation
alt Conversation exists
ConvService->>UserService: Fetch conversation with users
ConvService-->>Client: Return existing conversation
else New conversation
ConvService->>DB: Insert conversation
ConvService->>DB: Insert conversation_users records
ConvService->>ConvService: AddTalker hook (error handler)
ConvService->>DB: Create conversation_users join
ConvService->>ConvService: refetch hook (error handler)
ConvService->>DB: Fetch updated conversation
ConvService-->>Client: Return new conversation
end
deactivate ConvService
Client->>MsgService: create(message in conversation)
activate MsgService
MsgService->>MsgService: NestedPath + AddSender hooks
MsgService->>DB: Set userId from context
MsgService->>DB: Insert message
MsgService->>MsgService: refetch hook
MsgService->>DB: Fetch updated message with user
MsgService->>ConvService: patch(amountOfMessages)
ConvService->>DB: Update conversation counts
MsgService-->>Client: Return message with user details
deactivate MsgService
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Overview
Brief description of what this PR does, and why it is needed.
Closes: VWN-XXX
Type of Change:
Demo
Optional. Screenshots,
curlexamples, etc.Breaking Changes
Security Considerations
🔒 Any security implications, new permissions, or sensitive data handling
Performance Impact
⚡ Expected performance impact (positive, negative, or neutral) and any load testing performed
Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Checklist for Author
Code Quality
Testing
Database & Infrastructure
Documentation
Security & Performance
Checklist for Reviewer
Functional Review
Code Review
Integration Review
Testing Instructions
Prerequisites:
Test Cases:
Happy Path Testing:
Edge Case Testing:
Integration Testing:
Regression Testing:
Deployment Notes
Pre-deployment checklist:
Post-deployment verification:
Summary by CodeRabbit
Release Notes
New Features
Refactoring
✏️ Tip: You can customize this high-level summary in your review settings.