Skip to content

Count every open incident in the dashboard's Incidents badge - #499

Merged
jbrooksuk merged 1 commit into
cachethq:mainfrom
jayhemnani9910:fix/incident-badge-counts-all-open
Nov 2, 2026
Merged

jbrooksuk merged 1 commit into
cachethq:mainfrom
jayhemnani9910:fix/incident-badge-counts-all-open

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

Fixes #496.

The "Incidents" badge in the dashboard sidebar read Status::incidents()->unresolved, which is built on the guest scope viewableBy(false). An open incident visible only to users, or hidden, didn't count, so the badge showed 0 in green while the "Open incidents" card and table on the same dashboard showed it.

The badge now counts Incident::query()->unresolved(), the same query as the Overview card's open incidents. The public status page still uses Status::incidents().

Tested: a Pest test in IncidentResourceTest with an open "Users" incident, an open hidden one and a fixed public one expects a red badge of 2; on main it reads 0. Full suite in a local PHP 8.5 container: the same 71 failures as on main (500s from tests that render pages, environment), everything else passes. Pint passes.

@jbrooksuk
jbrooksuk merged commit 5a26dba into cachethq:main Nov 2, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incidents sidebar badge ignores open incidents that are not visible to guests

2 participants