When opening a new incident for a component, the system may report that an incident is already open even though the existing incident is not active.
Root cause is in GetEventsByComponentID
the IsActive filter determines activity only by incident.status and completely ignores start_date / end_date.
As a result, incidents with a past end_date but a non-final status (e.g. changed) are incorrectly treated as active.
The active-event logic here is inconsistent with the correct logic used elsewhere (based on date range + final statuses).
Expected behavior
An incident should be considered active only if:
end_date IS NULL, or
current time is between start_date and end_date and status is not final.
Actual behavior
Incidents are considered active solely based on status, causing false “incident already open” errors.