-
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
Priority: P2 (High - Fix Soon)
Problem
The Incident model has both a persisted status column AND a computed latestStatus attribute that looks at the latest Update. This creates inconsistencies across the codebase:
- Filament table (
IncidentResource.php:127) displayslatest_status - API resource (
Incident.php:27) returnslatestStatus - Filament filter (
:165) filters on the rawstatuscolumn scopeUnresolved()(:170) queries the rawstatuscolumn- Navigation badge (
:246-250) tries to reconcile both by queryingunresolved()(raw status) then re-filtering bylatest_status
This means an incident marked "investigating" in the DB but with a "fixed" update will still appear in scopeUnresolved() scope queries but then get filtered out in the badge — causing an N+1-like post-filter on every page load.
Suggested Fix
Consider a status computed column or event-driven sync so that the persisted status always reflects the latest update. Alternatively, make scopeUnresolved() join the updates table (as Status.php already does).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels