From 88ae6d59364fdaf671448da179817ad220b64fa3 Mon Sep 17 00:00:00 2001 From: Narrator Date: Thu, 29 Oct 2026 19:18:52 +0100 Subject: [PATCH] The wizard's rollback keeps each server's answers apart, or stops Like the CLI, it now saves the answers it replaces next to the server's own file instead of in one shared config.before-rollback.json, and if that copy can't be written it leaves the answers alone rather than overwriting the only copy. Co-Authored-By: Claude Opus 5.5 --- internal/ui/screens_tools.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/ui/screens_tools.go b/internal/ui/screens_tools.go index d562001..dd7c8a4 100644 --- a/internal/ui/screens_tools.go +++ b/internal/ui/screens_tools.go @@ -317,8 +317,11 @@ func (s *historyScreen) rollback(d deploy.Deploy) tea.Cmd { if err != nil { return nil } - // Keep the answers being replaced, in case they're wanted back. - _ = s.cfg.SaveFile(filepath.Join(config.Dir(), "config.before-rollback.json")) + // Keep the answers being replaced, in case they're wanted back; without + // that copy, don't replace them. + if err := s.cfg.SaveFile(config.BeforeRollbackPath()); err != nil { + return nil + } *s.cfg = *rc _ = s.cfg.Save() return run(deploy.Options{Action: deploy.ActionRollback}) @@ -342,7 +345,7 @@ func (s *historyScreen) view(w, h int) string { d := s.list[s.cursor] out += "\n\n" + confirmView(w, sWarn.Render("Roll back to "+d.Time.Local().Format("2006-01-02 15:04")+"?"), - sSub.Render("The playbook goes back to "+d.Commit[:min(10, len(d.Commit))]+" and your answers to the ones used then (today's are kept in config.before-rollback.json). The database is backed up first."), + sSub.Render("The playbook goes back to "+d.Commit[:min(10, len(d.Commit))]+" and your answers to the ones used then (today's are kept in "+tildePath(config.BeforeRollbackPath())+"). The database is backed up first."), sSub.Render("Newer homeserver versions may have changed the database in ways an older one can't read; if it fails to start, restore the backup taken now with Manage › Restore."), "", confirmKeys("enter", "roll back")) }