Latest Results
Show how long a device has been offline
Persist the moment a device stops being reachable and expose it as
``Device.runtime_state.offline_since``, an epoch second, on ``devices/list``
and on ``DEVICE_STATE_CHANGED``.
The status pill says "Offline" whether that started thirty seconds ago or
last week, and nothing else in the UI fills the gap: the drawer's
Reachability rows are per-channel last-seen ages, which are absent exactly
when the device has been unreachable since before the dashboard started.
Absolute rather than an age, so a client ticks it forward without a
per-response anchor and every surface showing it agrees by construction.
It rides the state-change event too, or a client folding that narrow event
would keep a previous outage's anchor and miss a fresh one.
A device already unreachable when the dashboard starts has no transition to
measure from, and anchoring on "now" there is wrong in a way that looks
right -- it times the dashboard's own uptime, and every device offline at
startup reports the same figure to the millisecond. So a coarse
``last_seen`` stamp is persisted while a device is reachable, the startup
settle anchors on that real last contact, and with neither stamp the field
stays null rather than inventing one.
Both stamps are queued in RAM by the sync state callback -- it cannot
schedule a store write, having no running loop -- and drained by
``devices/list`` and on shutdown. ``last_seen`` writes are rate-limited to
a minute since observations arrive every sweep for every reachable device.siegeld:feat/offline-duration Show how long a device has been offline
Persist an ``offline_since`` stamp when a device stops being ONLINE, clear
it when it returns, and expose the elapsed time as
``Device.runtime_state.offline_seconds`` on ``devices/list``. Add an
``offline_duration_visible`` preference, default off, for the frontend to
gate the display on.
The status pill says "Offline" whether that started thirty seconds ago or
last week, and nothing else in the UI fills the gap: the drawer's
Reachability rows are per-channel last-seen ages, which are absent exactly
when the device has been unreachable since before the dashboard started.
A device that is already unreachable when the dashboard starts has no
transition to measure from, and anchoring on "now" there would be wrong in
a way that looks right -- it times the dashboard's own uptime, and every
device offline at startup reports the same figure to the millisecond. So a
coarse ``last_seen`` stamp is persisted while a device is reachable, the
startup settle anchors on that real last contact, and with neither stamp
the field stays null rather than inventing one.
Both stamps are queued in RAM by the sync state callback -- it cannot
schedule a store write, having no running loop -- and drained by
``devices/list`` and on shutdown. ``last_seen`` writes are rate-limited to
a minute since observations arrive every sweep for every reachable device.siegeld:feat/offline-duration Latest Branches
0%
0%
siegeld:feat/offline-duration 0%
© 2026 CodSpeed Technology