You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bump version to v1.1.4 — fix false "Write reversion detected" warnings (#358)
Root-caused in detail by alanmk (SPH 3600 driven by Predbat, which writes every
5 min). Any controller writing on a fixed cadence eventually collides with an
in-flight poll and trips this.
_fetch_data() assembles its snapshot over several seconds. A write landing in
that window is not reflected in the snapshot, so _check_for_cloud_overrides()
compared the tracked value against registers read BEFORE the write and reported
the pre-write value as a reversion. The entry was then popped on that first
mismatch, so the write was never re-checked and could never be vindicated — a
guaranteed false alarm plus the once-per-session persistent notification.
Signature was distinctive: every false warning reported an age of 0-2s, and the
"reverted to" value was always the previous locally-written value. Recorder
history confirmed the writes had held.
Changes:
- Poll timestamping. _async_update_data() records poll_start before the reads
begin and passes it through. Any tracked write with write_time >= poll_start
is left pending and evaluated on the next poll, which genuinely post-dates it.
- Debounce. _pending_write_checks entries carry a mismatch_count; a write must
mismatch on two consecutive polls before being reported. A real revert
persists, a timing artefact does not.
- Expiry raised and scaled. The old flat 120s could not confirm a genuine
reversion even at the 60s default now that confirmation can need three cycles.
Now max(240s, 4 * scan_interval), based on the normal interval rather than the
temporary offline slow-poll interval so the latter cannot inflate it.
track_write()'s public 3-arg signature is unchanged; all 13 call sites across
number.py, select.py and time.py are unaffected. The 4-tuple is constructed in
one place and unpacked in one place.
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments