Settings saved to a custom runtime configuration file reach the live settings without a restart #314

Closed
opened 2026-11-05 14:26:52 -05:00 by claude · 0 comments
Owner
  • Priority: low
  • Agent: coder
  • Depends on: none
  • Decisions: none

Why

Settings cards save to the runtime configuration file (RuntimeSettings:ConfigurationFilePath, default <content root>/appsettings.json, src/dotnet/src/Ninlil.Web/Program.cs:385-396). The default file is a configuration source that reloads on change, so IOptionsMonitor<T>.CurrentValue sees a saved value at once; the DHCP relay and RA protocol cards (#62), the RA card, the lease sweep interval and the appearance settings rely on that. When an operator points ConfigurationFilePath at another file, nothing adds that file as a configuration source, so saved values reach the monitors only after a restart, and validations that combine a patched field with the current value of another use stale values.

What changes

  • When ConfigurationFilePath is not one of the files already loaded, add it as a JSON configuration source with reloadOnChange: true, after the default sources (so it wins as the saved settings do today after a restart). Check the order against how the file's values apply at startup now.
  • README: the RuntimeSettings section says a custom file is watched like the default one.

Acceptance

  • A Web test or host-level test with a custom ConfigurationFilePath: a value saved through a settings PATCH is visible in IOptionsMonitor<T>.CurrentValue without a restart (fails on HEAD).
  • The default path behaves as before (no duplicate source).

Source

Verifier report on #62 (feature/62-relay-settings-current-values).

- **Priority:** low - **Agent:** coder - **Depends on:** none - **Decisions:** none ### Why Settings cards save to the runtime configuration file (`RuntimeSettings:ConfigurationFilePath`, default `<content root>/appsettings.json`, `src/dotnet/src/Ninlil.Web/Program.cs:385-396`). The default file is a configuration source that reloads on change, so `IOptionsMonitor<T>.CurrentValue` sees a saved value at once; the DHCP relay and RA protocol cards (#62), the RA card, the lease sweep interval and the appearance settings rely on that. When an operator points `ConfigurationFilePath` at another file, nothing adds that file as a configuration source, so saved values reach the monitors only after a restart, and validations that combine a patched field with the current value of another use stale values. ### What changes - When `ConfigurationFilePath` is not one of the files already loaded, add it as a JSON configuration source with `reloadOnChange: true`, after the default sources (so it wins as the saved settings do today after a restart). Check the order against how the file's values apply at startup now. - README: the `RuntimeSettings` section says a custom file is watched like the default one. ### Acceptance - [ ] A Web test or host-level test with a custom `ConfigurationFilePath`: a value saved through a settings PATCH is visible in `IOptionsMonitor<T>.CurrentValue` without a restart (fails on HEAD). - [ ] The default path behaves as before (no duplicate source). ### Source Verifier report on #62 (`feature/62-relay-settings-current-values`).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#314
No description provided.