feat: add modem device tracking (reboots, SW updates, IPs) and refine event log#356
Conversation
|
Thanks for the work on this. I like the direction, especially keeping device lifecycle changes visible as first-class events instead of burying them in raw modem data. Before merging, I think a few things should be tightened up:
I would intentionally leave Smart Capture out of this. These are device lifecycle events, and I do not think they need to trigger Smart Capture as part of this PR. Once the whitespace, count filtering, and i18n bits are fixed, this should be in much better shape to merge. |
6fbc934 to
c219422
Compare
c219422 to
3d3d922
Compare
|
I completely agree with all your points, and I apologize for the messy state of the initial commit and for missing those counting and i18n details. I hope to have now addressed all the feedback and tightened up the implementation.
|
|
Thanks, this is moving in the right direction. The important behavior is there: lifecycle events are detected, can notify, and do not trigger Smart Capture by default. Before this can move forward, please tighten up a few things:
After that, I’ll re-review. |
3d3d922 to
1670108
Compare
… counting/test stability
1670108 to
1b6d4b2
Compare
|
Thanks!
|
Description
DOCSight now monitors additional values of the modem in addition to its signal levels. Key features:
Reboot Detection:
Automatically identifies when the modem reboots by monitoring uptime drops. It calculates and logs the "Prior Uptime" so you know exactly how long the connection lasted before the failure.
Firmware Monitoring:
Detects when the modem’s software version changes (useful for tracking ISP-pushed updates).
WAN IP Tracking:
Monitors both IPv4 and IPv6 address changes. This is especially helpful for users with dynamic IPs who want to see how often their ISP "rotates" their connection.
Zero Resource Impact:
It "piggybacks" on the existing data collection loop. No additional network requests or polls are needed, making it extremely lightweight.
Improved Device Support:
It provides a reliable reboot detection method for modems that don't expose DOCSIS error logs (like many Vodafone devices).
New "Device" UI:
Adds a dedicated filter in the Event Log, so you can separate system-level events (reboots/IPs) from signal-level events (SNR/Power drops).
While implementing the new device tracking, I fixed an architectural limitation in how unacknowledged events were counted.
Issue:
Previously, the event badge count was calculated client-side by checking only the currently loaded "page" of events. If a user had many events or active filters (like "Hide Operational"), the badge would be inaccurate because the browser couldn't "see" events on subsequent pages.
Fix:
Moved the counting logic to a new /api/events/count backend endpoint. This allows the database to perform a native COUNT(*) query that respects all active filters (severity, prefix, and operational status).
Result:
Sidebar and navigation counters are now accurate regardless of pagination or filters, and the UI no longer "jumps" between different counts during refreshes. Additionally, this improves performance by letting the database handle the calculation via a native COUNT(*) query rather than processing large event lists on the client-side.
Context:
Developing on a WSL2 setup on resource restricted hardware revealed some "race conditions" where the server or browser would occasionally time out or crash due to virtualization overhead.
Chromium Stability:
Added --disable-gpu, --disable-dev-shm-usage, --disable-setuid-sandbox, and --no-sandbox to the Playwright launch arguments. These flags make the tests much more robust in WSL2/virtualized environments.
Increased Boot Timeout:
Increased the server start timeout from 60s to 150s. On lower-end hardware, generating 9 months of demo data can be intensive, and this prevents the test suite from failing prematurely.
Updated ModemCollector unit tests to properly mock the new device_state storage calls. This resolves a TypeError that occurred when comparing mocked objects to integers.
User-Facing Impact
Type of Change
Checklist
python -m pytest tests/ -v)Testing
Test Environment:
Verification Commands:
Results:
Screenshots (if applicable):
Additional Notes