fix: clear stale errors on successful poll — prevents phantom error alerts

Same fix as applied to the pi Zulip extension: last_error_msg and
last_error_at are now cleared on every successful poll cycle, not
just on reconnect. Health monitors no longer show stale errors.
This commit is contained in:
Abiba (pi)
2026-06-29 22:22:59 +00:00
parent 0112c5bba7
commit 3bb7698f88
+4
View File
@@ -449,6 +449,10 @@ class ZulipAdapter(BasePlatformAdapter):
except Exception: except Exception:
pass pass
# Clear stale errors on successful poll cycle
self._health_stats["last_error_msg"] = None
self._health_stats["last_error_at"] = None
# Gen 4: Heartbeat logging — prove poll loop is alive # Gen 4: Heartbeat logging — prove poll loop is alive
now = time.time() now = time.time()
if now - self._last_heartbeat_time > HEARTBEAT_INTERVAL: if now - self._last_heartbeat_time > HEARTBEAT_INTERVAL: