Repository navigation
fix: pictique messages vanishing - #383
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughTwo services modified to enhance entity relationship handling: MessageService now eagerly loads related chat and sender entities during retrieval; subscriber.ts enriches loaded message entities with fully resolved User and Chat objects during post-processing. Changes
Sequence DiagramsequenceDiagram
participant MessageService
participant Subscriber
participant DB as Database
participant UserRepo as User Repository
participant ChatRepo as Chat Repository
MessageService->>DB: findOne(id, relations: [sender, chat])
activate DB
DB-->>MessageService: message with sender.id & chat.id
deactivate DB
Subscriber->>Subscriber: enrichEntity(message)
activate Subscriber
alt sender exists with id
Subscriber->>UserRepo: find(sender.id)
activate UserRepo
UserRepo-->>Subscriber: User entity
deactivate UserRepo
Subscriber->>Subscriber: assign User to enrichedEntity.sender
end
alt chat exists with id
Subscriber->>ChatRepo: find(chat.id, relations: [participants, messages])
activate ChatRepo
ChatRepo-->>Subscriber: Chat entity with relations
deactivate ChatRepo
Subscriber->>Subscriber: assign Chat to enrichedEntity.chat
end
Subscriber-->>Subscriber: return enrichedEntity
deactivate Subscriber
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
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 |
Description of change
messages from pictique kept vanishing for some reason
Issue Number
Type of change
How the change has been tested
Change checklist
Summary by CodeRabbit