## Summary - **DB pool exhaustion**: `device_has_effective_agent?` was doing 2 DB queries per call (3-table join + global settings lookup), called 2-3x per worker cycle across hundreds of devices (~6000 unnecessary queries/minute). Added an ETS-backed `AgentCache` with 120s TTL and removed redundant calls within the same worker cycle. - **Settings page crash**: `KeyError: key :user_agent not found` on BrowserSession — field doesn't exist, replaced with `device_type`. - **Login history IP truncation**: Changed from side-by-side grid to stacked table layout so IP addresses aren't clipped. ## Test plan - [x] 8 new tests for AgentCache (cache hit, miss, invalidation, global default) - [x] Full test suite passes (8651 tests, 0 failures, verified across multiple runs) - [x] `mix format` and pre-commit hooks pass Reviewed-on: graham/towerops-web#88 |
||
|---|---|---|
| .. | ||
| integration | ||
| mix/tasks | ||
| snmpkit | ||
| support | ||
| towerops | ||
| towerops_web | ||
| test_helper.exs | ||
| towerops_native_test.exs | ||