open-feature / ruby-sdk

Ruby implementation of the OpenFeature SDK
https://openfeature.dev
Apache License 2.0
21 stars 7 forks source link

Client always initializes with NoOpProvider #108

Closed grepfruit19 closed 4 months ago

grepfruit19 commented 4 months ago

Hi, attempting to follow the README instructions always results in initializing with the NoOp provider, even though it should be the InMemoryProvider. Attempting to use other Providers causes similar errors.

The following is the entirety of my Ruby program:

# frozen_string_literal: true

require "open_feature/sdk"

OpenFeature::SDK.configure do |config|
  config.set_provider(OpenFeature::SDK::Provider::InMemoryProvider.new(
    {
      "flag1" => true,
      "flag2" => 1
    }
  ))
end

# Create a client
client = OpenFeature::SDK.build_client(name: "my-app")
pp client

Anyone know what might be going on?

beeme1mr commented 4 months ago

Hi @grepfruit19, could you please try and create a client without specifying a name? The SDK is likely trying to scope the client to a domain that doesn't exist.

FYI, @maxveldink

grepfruit19 commented 4 months ago

Yeah I actually figured it out and fixed it locally, I'll put up a PR with my fix tomorrow.