mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-19 10:22:17 +00:00
6ce593f474
Every ~5 minutes the Pulse agent on a node already covered by an existing cluster endpoint re-announces itself via POST /api/auto-register. The handler ran the full add-the-standalone + consolidate path, which produced an identical persisted-config state. But it still wrote nodes.enc and called reloadFunc, which stops the multi-tenant monitor, sleeps 1 s, and rebuilds it from scratch. During the rebuild the WebSocket-visible resource store goes empty (nodes:0, vms:0, containers:0, dockerHosts:0), so every connected client sees every row flash blank and reappear. The Docker page made the flicker obvious because the rows are dense and stacked, but the regression hit every page in the UI. Fingerprint the persisted-config payload before any mutation and again after consolidation; when the fingerprints match, the auto-register is a no-op and SaveNodesConfig + reloadFunc are both skipped. Real changes (a new node, a rotated token, a captured fingerprint) still flow through unchanged. Add two regression tests: one drives the warm-up + steady-state heartbeat pair and asserts the second call does not call reloadFunc; the other rotates a token and asserts reloadFunc still fires.