Skip to content

Fix captive dependency: make DasBlogSettings reactive to config changes#777

Merged
poppastring merged 3 commits into
mainfrom
fix/reactive-config-settings
Feb 15, 2026
Merged

Fix captive dependency: make DasBlogSettings reactive to config changes#777
poppastring merged 3 commits into
mainfrom
fix/reactive-config-settings

Conversation

@poppastring
Copy link
Copy Markdown
Owner

Fix captive dependency: make DasBlogSettings reactive to config changes

DasBlogSettings previously snapshotted IOptionsMonitor.CurrentValue in its constructor, then was captured by singleton managers - freezing config for the app lifetime.

Changes:

  • Store IOptionsMonitor references and read .CurrentValue on each property access

  • Make URL properties (RssUrl, ShortCutIconUrl, etc.) computed so they reflect Root/Theme changes

  • Remove setters from IDasBlogSettings interface (no external callers)

  • Change IDasBlogSettings registration from Transient to Singleton

  • Remove manual config snapshot updates in AdminController (IOptionsMonitor with reloadOnChange:true handles this automatically)

DasBlogSettings previously snapshotted IOptionsMonitor.CurrentValue in its constructor, then was captured by singleton managers - freezing config for the app lifetime.

Changes:

- Store IOptionsMonitor<T> references and read .CurrentValue on each property access

- Make URL properties (RssUrl, ShortCutIconUrl, etc.) computed so they reflect Root/Theme changes

- Remove setters from IDasBlogSettings interface (no external callers)

- Change IDasBlogSettings registration from Transient to Singleton

- Remove manual config snapshot updates in AdminController (IOptionsMonitor with reloadOnChange:true handles this automatically)
Refactored DasBlog service registrations to use appropriate lifetimes (e.g., IDasBlogSettings as singleton instead of transient). Consolidated using statements. Added transient registrations for user and role stores, IPrincipal, and ISiteRepairer. These changes improve dependency injection setup and support user/role management.
@poppastring poppastring merged commit f88d3aa into main Feb 15, 2026
3 checks passed
@poppastring poppastring deleted the fix/reactive-config-settings branch February 15, 2026 23:22
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.

1 participant