fix: secure profile persistence ownership

This commit is contained in:
proxyctl coordinator
2026-07-17 02:29:58 +08:00
parent 80ab995e2e
commit 1fa7e0fb2d
6 changed files with 457 additions and 66 deletions
+13
View File
@@ -77,6 +77,19 @@ func (a *Application) Dispatch(intent Intent) Result {
})
if err == nil {
a.state = next
} else {
var committed *profile.CommitError
if errors.As(err, &committed) {
// Rename committed next before directory durability reporting failed.
// Prefer that state even if the required verification reload also fails.
a.state = next
reloaded, loadErr := a.store.Load()
if loadErr != nil {
err = errors.Join(err, fmt.Errorf("reload committed Profile configuration: %w", loadErr))
} else {
a.state = reloaded
}
}
}
return Result{Snapshot: a.Snapshot(), Notice: notice, Err: err}
}