Problem
When using multiple Selects chained together, putting a null labeled select in the middle causes that to take precedence even if a future label should have overridden it.
Example
Given the following Keys in AAC:

And the following code:
void Main()
{
IConfigurationRoot root = new ConfigurationBuilder()
.AddAzureAppConfiguration(opts =>
{
opts.ConfigureClientOptions(o => o.Diagnostics.IsLoggingEnabled = true);
var credential = new DefaultAzureCredential(new DefaultAzureCredentialOptions());
var aac = opts.Connect(new Uri("urlgoeshere"), credential);
aac.TrimKeyPrefix("Test:");
aac
.Select(KeyFilter.Any, "Development") // Gets all Keys with Development label
.Select(KeyFilter.Any, "WyzaTest") // Overrides any keys with WyzaTest label
.Select("Test:*") // Selects any keys starting with "Test:*" with no label
.Select("Test:*", "Development") // Selects any keys starting with "Test:*" with Development label
.Select("Test:*", "WyzaTest"); // Selects any keys starting with "Test:*" with WyzaTest label
aac.ConfigureKeyVault(kv => kv.SetCredential(credential));
}).Build();
System.Console.WriteLine(root.GetValue<string>("WyzaTest"));
}
The expected outcome should be that the word "boo" is written to the console because the very last selector of Test:* with label WyzaTest should have matched. Instead the actual result is that it returns true which is what the (no label) value is for that key.
If I change the selection to this, then it will properly resolve to boo as expected. Of course the layers of overrides won't quite behave the same way in this scenario since the goal was to override non-prefixed keys with their prefixed versions if they existed even if they didn't have a label.
.Select("Test:*") // Selects any keys starting with "Test:*" with no label
.Select(KeyFilter.Any, "Development") // Gets all Keys with Development label
.Select(KeyFilter.Any, "WyzaTest") // Overrides any keys with WyzaTest label
.Select("Test:*", "Development") // Selects any keys starting with "Test:*" with Development label
.Select("Test:*", "WyzaTest"); // Selects any keys starting with "Test:*" with WyzaTest label
If this really is the intended behavior, then I suggest something be added in to prevent (or warn) you from selecting a \0 label after any non-null label selection as it won't behave in the way that one might expect.
Problem
When using multiple
Selects chained together, putting a null labeled select in the middle causes that to take precedence even if a future label should have overridden it.Example
Given the following Keys in AAC:
And the following code:
The expected outcome should be that the word "boo" is written to the console because the very last selector of
Test:*with labelWyzaTestshould have matched. Instead the actual result is that it returnstruewhich is what the(no label)value is for that key.If I change the selection to this, then it will properly resolve to
booas expected. Of course the layers of overrides won't quite behave the same way in this scenario since the goal was to override non-prefixed keys with their prefixed versions if they existed even if they didn't have a label.If this really is the intended behavior, then I suggest something be added in to prevent (or warn) you from selecting a
\0label after any non-null label selection as it won't behave in the way that one might expect.