#6836·keep

[ Bug]: Alert badges never render on topology map nodes

Author: BigKAACreated Sep 22, 2026Updated Sep 23, 2026

Describe the bug

Topology map nodes never show the "N alerts" badge, even when alerts correlated with the service (alert.service == TopologyService.service) exist and are firing. Incident badges render fine; alert badges never do.

To Reproduce

Steps to reproduce the behavior:

  1. Have a topology with services (any provider) and at least one alert whose service matches a topology service.
  2. Go to 'Topology'.
  3. Nodes show application tags but no alert badge; in the browser network tab, loading the topology page never issues a /alerts/query request.

Root cause

keep-ui/app/(keep)/topology/ui/map/topology-map.tsx (line 457):

typescript
const { data: allAlerts } = useLastAlerts(undefined);

In keep-ui/entities/alerts/model/useAlerts.ts the SWR key is computed as api.isReady() && query ? <key> : null, so with query === undefined the key is null, the fetch never runs, allAlerts stays empty and the alertsCount > 0 branch in service-node.tsx is unreachable.

Expected behavior

Nodes with correlated alerts show an "N alerts" badge; clicking it opens the alert feed filtered by the service (the click handler and CEL filter already work).

Screenshots

Before (firing alert correlated with uniproxy-06 / uniproxy-04 — no badges): before

After the fix (badges on both nodes): after

Badge click opens the filtered feed (cel=service=="uniproxy-06"): feed

Additional context

  • Observed on main @ fe5c8964, self-hosted (docker compose).
  • One-line fix: pass an explicit query, e.g. useLastAlerts({ cel: "", limit: 1000, offset: 0 }). Happy to submit a PR (AI-assisted, verified on a lab stand with a live firing/resolved alert cycle).