Skip to content

Conversation

@Dumbris
Copy link
Contributor

@Dumbris Dumbris commented Oct 16, 2025

When configuration changes require a restart (like listen address changes),
the config was not being saved to disk. This caused the changes to be lost
after restart, as the server would load the old config file.

Root Cause:
In ApplyConfig(), the function returned early when RequiresRestart was true,
skipping the SaveConfig() call that happened later in the function.

Fix:
Moved the SaveConfig() operation to execute BEFORE checking if restart is
required. This ensures that:

  1. Config changes are persisted to disk immediately
  2. Restart-required changes take effect on next startup
  3. Hot-reloadable changes continue to work as before

Testing:

  • Added comprehensive tests in apply_config_restart_test.go
  • Verified listen address changes are saved despite requiring restart
  • Verified hot-reloadable changes still work correctly
  • Verified save failures are properly handled
  • All existing tests pass

Fixes issue where Web UI config editor changes to listen address were lost.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Pull Request

Description

Brief description of the changes in this PR.

Testing

  • I have tested these changes locally
  • I have added/updated tests that prove my fix is effective or my feature works
  • All existing tests pass

…changes)

When configuration changes require a restart (like listen address changes),
the config was not being saved to disk. This caused the changes to be lost
after restart, as the server would load the old config file.

**Root Cause:**
In `ApplyConfig()`, the function returned early when `RequiresRestart` was true,
skipping the `SaveConfig()` call that happened later in the function.

**Fix:**
Moved the `SaveConfig()` operation to execute BEFORE checking if restart is
required. This ensures that:
1. Config changes are persisted to disk immediately
2. Restart-required changes take effect on next startup
3. Hot-reloadable changes continue to work as before

**Testing:**
- Added comprehensive tests in `apply_config_restart_test.go`
- Verified listen address changes are saved despite requiring restart
- Verified hot-reloadable changes still work correctly
- Verified save failures are properly handled
- All existing tests pass

Fixes issue where Web UI config editor changes to listen address were lost.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Dumbris Dumbris merged commit 484b295 into main Oct 16, 2025
33 checks passed
@Dumbris Dumbris deleted the bugfix/config-port branch October 16, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants