Description
Integrate the notification dispatcher with the existing WebSocket hub so that a newly created notification is pushed in real time to any connected session belonging to the target user, immediately after the database write succeeds.
User Story
As a user who is currently logged in, I want to receive notifications instantly in my UI without having to refresh or poll, so that I am aware of critical events as they happen.
Acceptance Criteria
Definition of Done
Assumptions and Constraints
- Assumption: The project already has a working WebSocket hub with per-user connection tracking. This PBI extends it, not replaces it.
- Constraint: The WS delivery path must not introduce any latency to the database write path. If the hub is unavailable or slow, it must not delay the dispatcher's return.
Dependencies
No response
Additional Notes
No response
Description
Integrate the notification dispatcher with the existing WebSocket hub so that a newly created notification is pushed in real time to any connected session belonging to the target user, immediately after the database write succeeds.
User Story
As a user who is currently logged in, I want to receive notifications instantly in my UI without having to refresh or poll, so that I am aware of critical events as they happen.
Acceptance Criteria
Notificationstruct.SendToUser(userID string, msg WSMessage) errormethod (or equivalent). If the user has no active connections, the call is a no-op — the notification is already persisted and will be retrieved via REST on next login.notification.created, wrapping the full serialisedNotificationobject. The envelope format must be consistent with the project's existing WebSocket message conventions.Definition of Done
Assumptions and Constraints
Dependencies
No response
Additional Notes
No response