Skip to content

fix: Return correct name from FlagdProvider #126

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/OpenFeature.Contrib.Providers.Flagd/FlagdProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ namespace OpenFeature.Contrib.Providers.Flagd
/// </summary>
public sealed class FlagdProvider : FeatureProvider
{
const string ProviderName = "flagd Provider";
static int EventStreamRetryBaseBackoff = 1;
private readonly FlagdConfig _config;
private readonly Service.ServiceClient _client;
private readonly Metadata _providerMetadata = new Metadata("flagd Provider");
private readonly Metadata _providerMetadata = new Metadata(ProviderName);

private readonly ICache<string, object> _cache;
private int _eventStreamRetries;
Expand Down Expand Up @@ -121,7 +122,7 @@ internal FlagdProvider(Service.ServiceClient client, FlagdConfig config, ICache<
/// </summary>
public static string GetProviderName()
{
return Api.Instance.GetProviderMetadata().Name;
return ProviderName;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void BuildClientForPlatform_Should_Throw_Exception_For_Unsupported_DotNet
[Fact]
public void TestGetProviderName()
{
Assert.Equal("No-op Provider", FlagdProvider.GetProviderName());
Assert.Equal("flagd Provider", FlagdProvider.GetProviderName());
}

[Fact]
Expand Down