mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-24 04:07:16 +00:00
27373587c6
This commit addresses critical issues where nodes configuration was being lost or corrupted, causing user frustration and data loss. ## Changes: ### 1. Sync Script Protection (sync-production-config.sh) - Never overwrites newer dev config with older production files - Validates timestamps before syncing - Shows detailed logging of sync decisions - Prevents accidental overwrites of working configuration ### 2. Timestamped Backups (persistence.go) - Creates timestamped backup before EVERY save (e.g., nodes.enc.backup-20251001-073000) - Maintains "latest" backup for quick recovery - Auto-cleans old backups (keeps last 10) - Ensures we can always recover from corruption ### 3. Empty Config Protection (persistence.go) - BLOCKS attempts to save empty nodes config when existing nodes exist - Prevents accidental data wipes - Returns error with clear message about what was blocked ### 4. Enhanced Corruption Recovery (persistence.go) - Detects "cipher: message authentication failed" errors - Automatically attempts recovery from backup files - Renames corrupted files with timestamps for forensics - Logs detailed recovery process ### 5. Performance Logging (GuestRow.tsx) - Added timing for individual metadata API calls - Helps identify performance bottlenecks ## Why This Matters: Previous behavior allowed: - Corrupted files to overwrite working configs - Empty configs to delete all nodes - No way to recover from corruption - Race conditions during rapid restarts New behavior ensures: - Multiple backup copies always exist - Corruption auto-recovers from backups - Empty saves are blocked - Sync script validates before overwriting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>