Skip to content

fix(poller): preserve MAC sighting freshness across incomplete scans - #431

Merged
TheWitness merged 1 commit into
developfrom
feat/mactrack-collection-freshness
Nov 13, 2026
Merged

TheWitness merged 1 commit into
developfrom
feat/mactrack-collection-freshness

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Description

Keep aggregate sightings for devices without current Layer 2 observations and scope updates to the requested site. Preserve last-seen timestamps when changing active flags, retain MACs without current ARP translations, and label older observations in the aggregate report. Apply the aggregate writes transactionally and avoid increasing observation counts when retrying the same scan.

Related Issue

Fixes #430. Ref #414.

Motivation and Context

A failed device scan must not refresh an old sighting's timestamp, and missing ARP data must not hide a collected MAC. This change makes no claim that an empty or partially returned SNMP table is complete. It does not implement LLDP/CDP, VRF collection, interval history or vCenter integration.

How Has This Been Tested?

  • PHP 8.4.27 Linux: 378 tests passed against MariaDB 10.11.19 and MySQL 8.4, including five temporary-table database tests.
  • Measured changed executable lines: 100% coverage. The existing coverage policy excludes the poller and report entry points; their new database and formatting helpers are tested.
  • PHP syntax and manifest checks pass. PHPStan level 6 has the same 81 findings as upstream, with no additional findings.
  • New test files pass the Cacti formatter. Existing production-file formatting differences were left untouched.

No schema changes. Reverting restores the previous aggregate/report behavior. Hospital-device validation and a live Cacti browser check have not been performed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation repository accordingly.

Keep aggregate timestamps and site scope intact, retain Layer 2 observations without ARP translations, and label stale observations explicitly. Ref #430.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit 9b51547 into develop Nov 13, 2026
9 checks passed
@TheWitness
TheWitness deleted the feat/mactrack-collection-freshness branch November 13, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve aggregate MAC sightings when collection is incomplete

2 participants