Git Product home page Git Product logo

Comments (5)

kinyoklion avatar kinyoklion commented on August 16, 2024 2

The addition of the TargetingKey property has presented some problems for the LaunchDarkly provider. We had supported using attributes with the name "key" (convenient coming from an LD context) as well as "targetingKey". The TargetingKey not being in the map just meant we basically were unaware of it.

I wonder if we should have just made it short-hand for "targetingKey" as a member of the underlying structure. If we just export it, then we have to use some kind of name that will shadow whatever we pick. (Likely "targetingKey").

Instead we could adjust the general Set method to have restrictions on "targetingKey". We do something similar in LD contexts where if you call the set function with a built-in attribute we do our best, and then log if we cannot handle it.

Similar situation: https://github.com/launchdarkly/dotnet-sdk-common/blob/d248d74b29fb0d1e27771c5810b8277fd256e266/src/LaunchDarkly.CommonSdk/ContextBuilder.cs#L272

from dotnet-sdk.

toddbaert avatar toddbaert commented on August 16, 2024

@kinyoklion I think I understand what you're suggesting, but I want to be sure... Are you suggesting that you think the targeting key setter/getter should just retrieve a "special" property from the map (probably targetingKey?

I think that's fine, if so. I think the real problem is just that people will expect the AsDictionary() and GetEnumerator() to convey a targeting key, somehow if it's set.

We're close to being about to release a 2.0, so I'm reviewing some of these open issues.

from dotnet-sdk.

kinyoklion avatar kinyoklion commented on August 16, 2024

@toddbaert Yeah, I am suggesting that the key of "targetingKey" and the setter/getter for targetingKey should operate on the same value.

Which either requires a specially interacted with field or a special entry in the map with specialized logic for the set/get generic mechanisms.

Set("targetingKey", "potato");
TargetingKey = "potato";

var targetingKey = Get("targetingKey");
var targetingKey = TargetingKey

Should all basically be setting/getting the same field, and that field should also be in the dictionary.

from dotnet-sdk.

toddbaert avatar toddbaert commented on August 16, 2024

I'm fine with that. I'll add it to the description, and try to get to it myself if nobody else does first.

from dotnet-sdk.

toddbaert avatar toddbaert commented on August 16, 2024

I'm starting on this.

from dotnet-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.