Closed Kameleoon closed 1 month ago
Hey @maxveldink, is this something you could help with?
Sure! I've got an idea to expand that section out anyway and remove that metaprogramming. I'll clean it up tomorrow morning if I've got some time, and when I'm back from vacation Monday if not.
Apologies for the delay here; I'm taking a look this morning. I'm not able to replicate this locally loading the gem in a console and my projects utilizing OF don't appear to have this issue. That method is being appropriately forwarded to the API instance. Do you have a snippet of calling code which is triggering this?
Related to this issue, I do plan on expanding this metaprogramming out so it's clearer and tooling can better analyze the eval methods. That could eliminate this issue as well, or help us pinpoint it.
Hello @maxveldink
Do you have a snippet of calling code which is triggering this?
client = OpenFeature::SDK::API.instance.build_client evaluation_details = client.fetch_string_details(flag_key: feature_key, default_value: 'test', evaluation_context: eval_context)
throws:
NoMethodError: undefined method `evaluation_context' for module OpenFeature::SDK /opt/homebrew/lib/ruby/gems/3.3.0/gems/openfeature-sdk-0.4.0/lib/open_feature/sdk/client.rb:29:in `fetch_string_details'
Hello @maxveldink.
Hope you're well.
Do you have any news? Estimated time?
Thanks!
Yes, sorry for the delay; I'll be working on this tomorrow (I think I've got the under lying reason) and will cut a release once that's approved.
@Kameleoon I've been playing around with this issue tonight, and I'm unable to replicate that problem locally on main
. Your snippet was helpful, but I'm seeing a successful evaluation there.
One thing I noticed was you're creating the client
through the singleton instance
method; the primary entrypoint should be OpenFeature::SDK.build_client
(but I don't see how that would cause this problem, but would be worth a shot).
I've been meaning to refactor away from metaprogramming here in favor of explicit method defs, so I've created a draft to do that at #154. Could you also build off of that branch and see if you're seeing the same issue?
@Kameleoon can you provide any more context around how you're initializing OF in your project, or a wider code snippet? @DmitryAE I wonder if you could provide a code snippet/context as well.
Thank you 🙏🏻
Hello @maxveldink
I hope you're doing well.
I want to sincerely apologize for the delayed response. After applying your suggestion to call methods without API.instance
, we identified an issue on our end with how we imported the OpenFeature SDK. We mistakenly imported open_feature/sdk/api
, which was necessary due to our use of API.instance
(as we thought), and this turned out to be the root cause.
We deeply regret any inconvenience this may have caused you. Your guidance was invaluable, and we greatly appreciate your support throughout this process.
Thank you once again for your help!
Best regards, The Kameleoon Team
P.S. Please disregard the message from @DmitryAE, which is the personal account of one of our developers. It pertained to the same issue.
Glad that we got it solved! Reach out if you have any other issues with the SDK!
Hello guys!
In the latest version (0.4.0), the
fetch_{result_type}_{suffix}
evaluation methods are not functioning as expected. This issue appears to stem from a call to an undefined methodevaluation_context
in theOpenFeature::SDK
. Below is the problematic code:There is a problematic line in the code:
Any call to
fetch_{result_type}_{suffix}
throws the following error: