Repository navigation
feat(alerts): alert when a new client is seen for the first time - #1397
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
noteDevicesSeennow returns first-timers: MACs inserted intodevice_seenfor the first time that already carry a name. Nameless ones stay with unknown-device, so a new client never alerts twice.trackNewClients: clients-category info alert, urgent so it also pushes, one-shot per MAC persisted in kv (new_client_alerted:, same semantics asunknown_alertedUnknown-device alert re-fires on every reconnect of the same device (no per-MAC memory) #248). A MAC that already alerted as unknown does not re-alert here when it later gains a name; tombstoned clients (Client list management issues continue #1278/fix(clients): deleted clients stay deleted; fleet MACs purged; sane IPs #1290) never re-alert.Verification
Closes #1323