mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-24 20:22:53 +00:00
501c61b82f
Two gaps in the existing flow allowed a disconnected PVE node to stay broken indefinitely even after the agent restarted: 1. Server-side: autoRegisteredNodeExists checked only that a PVE/PBS instance existed in the config, not whether its connection was healthy. A node with a stale token would return registered=true on every check, causing the agent to skip re-registration forever. Fixed: also consult GetConnectionStatuses(); return registered=false when the monitor has a definitive disconnected entry so the agent can rotate and re-register. 2. Agent-side: the type-specific registration marker was cleared only on success. If rotation succeeded but the Pulse update failed (e.g. transient network error), the old marker from a previous successful registration persisted, leaving next-startup to skip setup again. Fixed: clear the marker before entering the token setup/rotation phase so any failure leaves the system in a retriable state. Together these two fixes make the stale-token scenario self-healing: the monitor detects the broken connection, the next agent startup sees registered=false, clears its marker, rotates the token, and updates Pulse — without manual intervention.