Files
ai-agent/backend/ui_state.py
Gabriel Vidal 96ab64b0f2 fix(ui-state): never persist defaults over the server file after a failed read
A failed settings read (expired Authelia session -> synthetic 401, network
blip, HTML login page) left the store on its defaults, and the next settings
change PUT them over ui-state.json — wiping the whole prompt-shortcut config.
The same path could also push a stale pre-July localStorage copy.

- serverStorage: writes are held until the server value was actually read;
  failed reads are retried on focus/online/30s via retryHydration(store);
  the localStorage bridge only runs on a confirmed-empty server.
- ui_state.py: daily ui-state.json.bak-YYYY-MM-DD snapshot, 14 kept.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 12:04:32 +02:00

3.2 KiB