Skip to content

feat(alerts): alert when a new client is seen for the first time - #1397

Merged
gnacho merged 1 commit into
mainfrom
feat/1323-new-client-alert
Oct 13, 2026
Merged

gnacho merged 1 commit into
mainfrom
feat/1323-new-client-alert

Conversation

@gnacho

@gnacho gnacho commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Request (#1323, via #1322)

A device with a DHCP reservation (known hostname, never seen before) joined the network and was silently added to the client list - no log entry, no banner, no notification. The only client-join alert was "unknown device", which fires only for nameless clients after a few poll ticks (#234); a named-but-new client never alerts.

Changes

Verification

  • 4 new tests: named first-timer alerts once with full vars, nameless stays with unknown-device, empty-table seeding is silent but later joins alert, unknown-alerted guard. Full server suite green.
  • Live preview on the home fleet: zero new-client avalanche after restart against the months-old registry; clean log.
  • UI E2E (Playwright, overview injection): alert renders translated with title/description/hint, URGENT + CLIENTES badges, unread dot. Screenshot verified.

Closes #1323

The only client-join alert was 'unknown device', which fires only for
nameless clients after a few poll ticks (#234). A device that resolves a
hostname on the first tick (DHCP reservation, static name) was never
unknown, so a named-but-new client joined silently - no log, no push.

- noteDevicesSeen now returns the first-timers (MACs inserted into
  device_seen for the first time) that already carry a name; nameless
  ones stay with unknown-device so a new client never alerts twice.
- Startup anti-avalanche: when the table was empty on entry (first boot
  or fresh DB), the whole online set is seeded silently; later additions
  alert normally.
- trackNewClients emits a clients-category info alert, urgent so it also
  pushes, one-shot per MAC persisted in kv (new_client_alerted:) with
  the same semantics as unknown_alerted (#248). A MAC that already
  alerted as unknown does not re-alert here when it later gains a name,
  and tombstoned clients (#1278/#1290) never re-alert.
- Carries name/mac/ip/router/attachment; i18n es/en.

Tests: named first-timer alerts once with full vars, nameless stays with
unknown-device, empty-table seeding is silent but later joins alert,
unknown-alerted guard.

Closes #1323
@gnacho
gnacho merged commit 0fac2f9 into main Oct 13, 2026
2 checks passed
@gnacho
gnacho deleted the feat/1323-new-client-alert branch October 13, 2026 22:23
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.

Alert and log when a new client is seen for the first time

1 participant