# Upgrade Guide — v0.12.11

<!-- bump: patch -->

## What Changed

Fixed a notification loop bug in the auto-updater where `gatedRestart()` set the notification dedup state (`lastNotifiedRestartVersion`) in memory but never called `saveState()` before the process exited. On restart, the dedup state was lost, causing the "Just updated to vX.Y.Z. Restarting to pick up the changes." notification to repeat every ~5 minutes indefinitely.

Three-layer fix:
1. **State persistence before restart**: `saveState()` is now called inside `gatedRestart()` immediately before `requestRestart()`, ensuring dedup state survives process exit.
2. **Restart cooldown (30 min)**: New `lastRestartRequestedAt` and `lastRestartRequestedVersion` fields are persisted. If a restart was already requested for the same version within 30 minutes, it's skipped entirely. This is a safety net for binary path mismatches (e.g., npx cache vs global install).
3. **State fields persisted in auto-updater.json**: `lastRestartRequestedAt` and `lastRestartRequestedVersion` are now saved and loaded alongside the existing dedup fields.

## What to Tell Your User

- **Update notification fix**: "The repeated 'Just updated' notifications should stop now. The server was getting stuck in a restart loop because it forgot it had already notified you. That's fixed."

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| Notification dedup persistence | Automatic — no action needed |
| Restart cooldown (30 min) | Automatic — prevents rapid restart cycling |
