Skip to content

Conversation

@hussein-saad
Copy link
Collaborator

This pull request introduces real-time notification functionality to the chat system by integrating the NotificationService with the ChatGateway. Key changes include managing user connections, enabling real-time notification delivery, and ensuring module dependencies are properly configured.

Enhancements to ChatGateway for Notifications:

  • Added a userSocketMap to track connected sockets for each user and manage their notification rooms. (src/chat/chat.gateway.ts, src/chat/chat.gateway.tsR39-R47)
  • Implemented logic to join users to notification rooms upon connection and fetch/send their unread notifications in real time. (src/chat/chat.gateway.ts, src/chat/chat.gateway.tsR65-R93)
  • Added methods to send notifications to specific users, check if a user is online, and handle subscription to notifications. (src/chat/chat.gateway.ts, src/chat/chat.gateway.tsR103-R142)

Integration of Notifications Module:

  • Imported the NotificationsModule into the ChatModule to establish a dependency between the two modules. (src/chat/chat.module.ts, [1] [2]
  • Added a forward reference to the ChatModule in the NotificationsModule to resolve circular dependencies. (src/notifications/notifications.module.ts, src/notifications/notifications.module.tsL1-R16)

Updates to NotificationService:

@hussein-saad hussein-saad merged commit d5ee636 into main Apr 20, 2025
1 check failed
@hussein-saad hussein-saad deleted the feat/notifcation branch April 20, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant