Bugfix/notification#88
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR refactors notification-read marking from client-side to server-side. When accessing an incident, the controller now marks all unread notifications for that incident as read before returning the incident data. Repository and service layer methods have been updated to query and mark notifications by incident ID, with unread notifications now sorted by creation date descending. Changes
Sequence DiagramsequenceDiagram
actor User
participant Dashboard as Dashboard (UI)
participant IncidentCtrl as IncidentController
participant NotifService as NotificationService
participant IncidentService as IncidentService
participant NotifRepo as NotificationRepository
participant DB as Database
User->>Dashboard: Click notification
Dashboard->>IncidentCtrl: GET /incidents/{incidentId}
IncidentCtrl->>NotifService: markNotificationAsReadForIncident(userId, incidentId)
NotifService->>NotifRepo: findByUserIdAndIncidentIdAndReadFalse(userId, incidentId)
NotifRepo->>DB: Query unread notifications
DB-->>NotifRepo: Unread notifications for incident
NotifService->>NotifRepo: saveAll(marked as read)
NotifRepo->>DB: Update notifications
DB-->>NotifRepo: Confirmed
IncidentCtrl->>IncidentService: getById(incidentId, currentUser)
IncidentService->>DB: Fetch incident
DB-->>IncidentService: Incident data
IncidentService-->>IncidentCtrl: Incident
IncidentCtrl-->>Dashboard: Incident response
Dashboard->>User: Display incident
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary by CodeRabbit
Release Notes
New Features
Refactor