Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions static/app/types/system.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,6 @@ interface StatusPageAffectedComponent {
}

export interface StatusPageIncidentUpdate {
/**
* Components affected by the update
*/
affected_components: StatusPageAffectedComponent[];
/**
* Message to display for this update
*/
Expand Down Expand Up @@ -400,6 +396,10 @@ export interface StatusPageIncidentUpdate {
* ISO Update update time
*/
updated_at: string;
/**
* Components affected by the update
*/
affected_components?: StatusPageAffectedComponent[];
}

// See: https://doers.statuspage.io/api/v2/incidents/
Expand Down
10 changes: 8 additions & 2 deletions static/app/utils/useServiceIncidents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ export function useServiceIncidents({
}
if (componentFilter) {
filteredIncidents =
incidents?.filter(inc =>
inc.components.some(comp => componentFilter.includes(comp.id))
incidents?.filter(
inc =>
// Find incidents that include any of the componentFilter
inc.components.some(c => componentFilter.includes(c.id)) ||
// Find any incident with an update that includes any of the componentFilter.
inc.incident_updates.some(update =>
update.affected_components?.some(c => componentFilter.includes(c.code))
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Component Filter Bypasses Resolved Status

The component filter applies to the original incidents array instead of the already-filtered filteredIncidents. When both !includeResolved and componentFilter are active, resolved incidents may incorrectly appear in the results, as the resolved status filtering is bypassed.

Fix in Cursor Fix in Web

) ?? null;
}

Expand Down
Loading