Skip to content

Asset Inventory and Devices Tab PR Review

Ed Mozley edited this page Dec 5, 2026 · 1 revision

Asset inventory noise and the Devices tab - PR review (#519, #520)

Two Assets pull requests from @Dr4inder, both measured on a real Windows 11 laptop with a dock, merged 5 December 2026, in 6.0.0.

PR What it does Verdict
#519 The agent sends real hardware, one program per name, runtimes as components Merge + fix
#520 The Devices tab loads again; CPU speed and memory in GHz and GB Merge (+ CI step)

#519 - fewer devices, one program per name, runtimes as components

What it set out to do. Three things made the inventory noisy or wrong:

  1. Device Manager: 333 devices, most of them noise - PCI bridges, system devices, HID entries, volumes, WAN miniports, print queues and a dozen Bluetooth services per paired phone. The agent now sends the hardware people ask about (graphics, network, disks, monitors, printers, cameras, imaging, Bluetooth, audio, keyboards, mice, card readers, fingerprint readers, the TPM and the battery), only real hardware (no ROOT\, SW\, SWD\, BTH…\ or {GUID}\ instance ids), and every device Windows reports a problem with, whatever its class. 333 became 31.
  2. A program with two uninstall entries became a "component". An installer bundle and the hidden MSI inside it share a name; Sort-Object DisplayName -Unique kept whichever came first, often the hidden one. Now the entry Programs and Features shows wins - in the agent and in both script-library senders.
  3. Runtime libraries counted as applications - a dozen Visual C++ and .NET entries per PC. AssetInventoryService::isRuntime() keeps them with the components for every source.

What was good - copy this

  • Measured before and after on a real machine, with the numbers in the PR (333 to 31 devices; STARFACE App component to application; 87 applications and 324 components).
  • The fix is in all three senders, not just the one that showed it: the agent, and the PowerShell and Python scripts in the API script library had the same "first one wins" de-duplication.
  • A rule with its counter-examples. tests/asset-inventory-runtimes.php (20 checks) lists real runtime names that must match and names that must not - an SDK, a templates pack, Paint.NET - with a control.
  • Server-side where it can be. The runtime rule works for every source the moment the server is upgraded; only the device filter and the duplicate fix wait for agents to be updated, and the PR says so.

What had to be fixed. The device filter changes what every agent reports, and some administrators do want the full Device Manager list - USB devices, licence dongles, HID keys. Where opinions differ FreeITSM offers a setting, so the agent has a switch:

.PARAMETER AllDevices
    Send every present device in Device Manager, as before PR #519, instead of the
    hardware people ask about (...) plus any device Windows reports a problem with.
Where-Object { $AllDevices -or $_.Status -ne 'OK' -or (($deviceClasses -contains $_.Class) -and $_.InstanceId -notmatch $notHardware) }

The new list is the default - a deliberate exception to "today's behaviour stays the default", because the old list was about nine parts noise. The Assets help said in three places that the Devices tab shows exactly what Device Manager shows; it now says what it holds and names -AllDevices.

#520 - the Devices tab spun for ever; raw numbers for CPU and memory

What was wrong. The signed-in devices dialog (GH #443) in the shared header (includes/waffle-menu.php) named its list devicesList. The asset page's Devices tab already had that id. The header comes first in every page, so the tab's getElementById('devicesList') found the dialog's list, drew every row into the hidden dialog (0 Γ— 0 px), and left its own list spinning. Separately, CPU speed and memory were shown as stored: 3301000000 and 34359738368.

Before After
Before: raw Hz and bytes After: 3.30 GHz and 32.0 GB

After: the Devices tab lists the asset's devices by class

What was good - copy this

  • The shared component gives way. The header is on every page, so its id changed (signedInDevicesList), not the asset page's.
  • A guard for the whole class of bug, not just this case: tests/header-ids-unique.php fails when any page uses an element id the shared header has. The existing duplicate-element-ids test checks each file on its own and could not see it. With the old header it names exactly asset-management/index.php / devicesList, the only clash among the header's 35 ids.
  • Units that match what people already see: GB means GiB, as Windows and the disk sizes on the same page count; a value under 10⁢ has no known unit and is shown as stored; sorting in the table still uses the number.
  • It says what was not checked - the table view's formatted columns on screen.

What was added on top. The new guard needs no database, so it now runs in CI with the other files-only guards (.github/workflows/web-exposure.yml). Nothing in the PR itself needed changing.

How it was tested

On a test install with seeded devices: before, the page had two elements named devicesList and the tab spun; after, one, and the tab lists the devices by class. CPU speed and memory read 3.30 GHz and 32.0 GB. tests/asset-inventory-runtimes.php 20 of 20, tests/header-ids-unique.php passes, and the agent script parses with the new switch.

Files

File PR Change
πŸ”΄ scripts/Invoke-AssetInventory.ps1 #519 Device filter, -AllDevices (fix), one program per name
πŸ”΄ includes/services/asset_inventory.php #519 isRuntime()
🟑 script-library/powershell/send-this-pc-inventory.ps1, script-library/python/send-this-pc-inventory.py #519 One program per name
🟑 asset-management/help.php #519 What the Devices tab holds (fix)
πŸ”΄ includes/waffle-menu.php #520 signedInDevicesList
🟑 asset-management/index.php, assets/js/asset-table.js #520 GHz and GB
🟒 tests/asset-inventory-runtimes.php, tests/header-ids-unique.php, .github/workflows/web-exposure.yml both New tests; the guard in CI

What this means for you

Update the agent on your PCs to get the shorter device list and the bundle fix (add -AllDevices to keep the old list). The runtime rule and the Devices tab fix apply as soon as you upgrade. See Inventory agent and Assets.

Related

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally