Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure cleared path when starting new settings group #552

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Jun 21, 2024

Following this suggestion, I started reading my custom settings directly from IApp.Settings. But I noticed that the keys for my settings weren't as expected.

With the following configuration:

MeadowCloud:
    # Enable Logging, Events, Command + Control
    Enabled: false

MyApp:
    Setting1: test1
    Setting2: test2

My custom settings keys were prefixed with MyApp (e.g., MyApp.Setting1). However, if I comment out all the settings in the previous section:

MeadowCloud:
    # Enable Logging, Events, Command + Control
    # Enabled: false

MyApp:
    Setting1: test1
    Setting2: test2

My custom settings keys were now prefixed with MeadowCloud.MyApp, and my code to retrieve them failed with a KeyNotFoundException.

The changes in this PR reset the settings level breadcrumbs when a new section starts, resulting in the expected key prefix for the setting.

@ctacke ctacke merged commit 02f5cdb into WildernessLabs:develop Jun 28, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants