Commit Graph
89 Commits
Author SHA1 Message Date
copilot-swe-agent[bot]andjokob-sk f52cc50705 fix: address review feedback on NIC presence logic and tests
- Replace max() with explicit if/else for readability
- Use db_test_helpers (make_db, make_device_dict, insert_device_from_dict,
  DummyDB) instead of local mock DB objects in test_nic_presence.py
- Lowercase all MAC addresses in tests

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 08:52:43 +00:00
copilot-swe-agent[bot]andjokob-sk 283bea21c9 fix: NIC child presence no longer forces a directly-detected parent offline
When a parent device has NIC children, update_devPresentLastScan_based_on_nics
previously replaced the parent's devPresentLastScan unconditionally with the
NIC-derived value. This discarded any genuine direct detection of the parent:
if the parent was found by ARP/save_own_device (present=1) but its NIC child
was absent (present=0), the NIC step forced the parent back to 0. The next
scan re-detected the parent → Connected event → NIC forced it down again,
producing an endless one-directional Connected event stream.

Fix: use max(original, nic_derived) so NIC children can only raise a parent's
presence (bring an undetected parent online), never lower it when the parent
itself was directly detected this cycle.

Adds test/scan/test_nic_presence.py covering the exact regression scenario
and surrounding cases (raise, no-NIC unchanged, req_all modes).

Fixes #1736

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 08:44:00 +00:00
jokob-sk 1636d155c7 BE+FE: report findinfg fixes + css 2026-07-12 10:26:53 +10:00
jokob-sk 351b6a7d28 BE: unable to exclude loacl_MAC entries #1700 2026-07-04 09:36:24 +10:00
Jokob @NetAlertX 87a89f3a28 Add active_labels parameter to resolve_devices for selective strategy execution 2026-05-22 23:00:25 +00:00
Jokob @NetAlertX 88231d97c8 Enhance documentation and implement SET_ALWAYS functionality for device name resolution #1650 2026-05-22 22:50:33 +00:00
jokob-sk 7c7beaaf96 BE: empty checks fix
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-15 10:43:22 +10:00
jokob-sk c0462984e7 BE: feedback + unify null / empty checks
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-15 10:35:09 +10:00
Jokob @NetAlertX 89139fed60 Add update_sync_hub_node function and corresponding tests for backfilling devSyncHubNode #1609 2026-04-14 20:59:36 +00:00
Jokob @NetAlertX c80dc9c36a PLG: Centralize SQL condition to skip forced-online devices in event inserts 2026-04-10 22:13:09 +00:00
Jokob @NetAlertX 50be56c8bb PLG: Enhance device event handling for forced-online status #1602 2026-04-10 21:44:03 +00:00
Jokob @NetAlertX 0a7ecb5b7c Update config.json files to add 'ordeable' option and refactor cacheStrings function for consistency 2026-03-17 09:22:25 +00:00
Jokob @NetAlertX c7399215ec Refactor event and session column names to camelCase
- Updated test cases to reflect new column names (eve_MAC -> eveMac, eve_DateTime -> eveDateTime, etc.) across various test files.
- Modified SQL table definitions in the database cleanup and migration tests to use camelCase naming conventions.
- Implemented migration tests to ensure legacy column names are correctly renamed to camelCase equivalents.
- Ensured that existing data is preserved during the migration process and that views referencing old column names are dropped before renaming.
- Verified that the migration function is idempotent, allowing for safe re-execution without data loss.
2026-03-16 10:11:22 +00:00
Jokob @NetAlertX 3a73817048 Enhance device down event handling for sleeping devices and improve down alerts query 2026-03-02 10:05:37 +00:00
Jokob @NetAlertX 8e6efc3008 sleeping devices status #1519 2026-03-02 04:35:07 +00:00
jokob-sk 9676111ceb BE: Events deduplication and uniqueness
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-15 13:59:15 +11:00
Jokob @NetAlertX 45157b6156 timestamp cleanup 2026-02-11 01:55:02 +00:00
jokob-sk e899f657c5 BE+FE: refactor totals retrieval + LUCIRPC old field name
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-10 07:39:11 +11:00
jokob-sk 946ad00253 FIX: lowercase MAC normalization across project v0.1
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-07 13:44:50 +11:00
jokob-sk 8e83d9b67d BE: Removal of debug code taht was causing devices to appear online #1489
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-06 14:18:15 +11:00
jokob-sk 81202ce07e name resolution config clean up, authoritative fields fixes for none values, css fixes
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-03 20:40:11 +11:00
jokob-sk 4c9c89050b DOCS+FE+BE: cleanup, SSE wait for app initialization #1440
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-01 10:36:31 +11:00
jokob-sk 1e1d4cd045 better heuristics
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-30 18:12:43 +11:00
jokob-sk fa40880c05 heuristics fix
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-30 09:48:08 +11:00
jokob-sk 2d6e357fe5 BE+FE: new fields handling in views and skipping device heuristics for random macs
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-30 09:09:39 +11:00
jokob-sk 229ea770cb feat: authoritative plugin fields - fix devFQDN + docs + allow filters and columns on new fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-30 07:50:21 +11:00
jokob-sk 596a30fe01 feat: authoritative plugin fields - fix devLastIP
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-29 11:01:02 +11:00
jokob-sk 1f5d6f96a4 feat: authoritative plugin fields - fix devLastIP
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-29 10:48:30 +11:00
jokob-sk 2086e78a39 TEST: field locking test fixes 7
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-29 10:17:45 +11:00
jokob-sk 7faaa630a1 TEST: field locking test fixes 6
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-29 10:02:09 +11:00
jokob-sk dc2a56aac3 BE+TEST: field locking test fixes 3, ipv4/6 handling fix
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-29 08:27:27 +11:00
jokob-sk d24411fa53 BE: CurrentScan table leanup - column rename
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-25 16:38:45 +11:00
jokob-sk 4991b058d3 feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-25 00:20:06 +11:00
jokob-sk 8ea84a22e9 feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-25 00:04:06 +11:00
jokob-sk 899017fdd8 feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-24 23:37:51 +11:00
jokob-sk 3775e21dc7 feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-24 22:20:30 +11:00
jokob-sk 2acc180fd5 feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-24 16:24:43 +11:00
jokob-sk be381488aa feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-01-24 16:19:27 +11:00
Jokob @NetAlertX cafa36f627 feat: Enhance readonly input styles and improve device data handling 2026-01-22 09:57:48 +00:00
Jokob @NetAlertX 49e689f022 Refactor authoritative field handling and enhance device update logic
- Updated `get_source_for_field_update_with_value` to determine source values based on new field values, including handling for empty and unknown values.
- Introduced `get_overwrite_sql_clause` to build SQL conditions for authoritative overwrite checks based on plugin settings.
- Enhanced `update_devices_data_from_scan` to utilize new authoritative settings and conditions for updating device fields.
- Added new tests for source value determination and device creation to ensure proper handling of source fields.
- Created in-memory SQLite database fixtures for testing device creation and updates.
2026-01-22 04:33:49 +00:00
Jokob @NetAlertX fcbe4ae88a feat: Implement forced device status updates and enhance related tests 2026-01-21 09:21:55 +00:00
Jokob @NetAlertX 478b018fa5 feat: Enhance plugin configurations and improve MAC normalization 2026-01-21 01:58:52 +00:00
Jokob @NetAlertX 3ee21ac830 review fixes 2026-01-21 00:17:54 +00:00
Jokob @NetAlertX 3b203536b8 ALL:Authoritative plugin fields 2026-01-19 11:28:37 +00:00
Jokob @NetAlertX d849583dd5 refactor UI backend calls to python endpoints 2026-01-10 03:06:02 +00:00
Jokob @NetAlertX 8c982cd476 MCP refactor
Signed-off-by: GitHub <noreply@github.com>
2025-12-07 08:20:51 +00:00
jokob-sk 139447b253 BE: mylog() better code radability
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-25 07:54:17 +11:00
jokob-sk 5c14b34a8b BE: linting fixes
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-22 13:14:06 +11:00
jokob-sk b6567ab5fc BE: NEWDEV setting to disable IP match for names
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-13 20:22:34 +11:00
jokob-sk a98bac331d MERGE: resolve conflicts
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-10 10:11:34 +11:00