Clarify settings apply/save comment; strengthen settings tests
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -26,9 +26,11 @@ func (s *Server) handleGetSettings(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, cur)
|
||||
}
|
||||
|
||||
// handlePostSettings validates-and-applies atomically, then persists. The applier
|
||||
// checks the backend before mutating any state, so an invalid backend yields 400
|
||||
// with nothing saved and the prior wiring intact.
|
||||
// handlePostSettings applies the new settings first, then persists them. The
|
||||
// applier checks the backend before mutating any state, so an invalid backend
|
||||
// yields 400 with nothing saved and the prior wiring intact. If Save fails after
|
||||
// a successful apply, the running adapters are already rewired but the file and
|
||||
// the in-memory copy are left unchanged; that surfaces as 500.
|
||||
func (s *Server) handlePostSettings(c *gin.Context) {
|
||||
var req settings.Settings
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user