1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/src/lib/util
Thomas Heartman 98a6cd05c6
Feat(#1873): return 'unknown' for application hostname strategies (#1889)
The hostname strategy will not work correctly with the playground because it depends on external state. In its constructor, it tries to query the environment or use the os.hostname function to determine what its current hostname is. This means that no matter what the user does in the playground, they can’t affect the results of this strategy. It’s also unlikely that it will be true. And if it is, it probably won’t be true for their clients.

In theory, we could accept a hostname property on the Unleash context and use the provided hostname in the address. However, I’m afraid that it’ll make users think that they can impact the hostname strategy by setting the property on their context, when that doesn’t do anything outside of the playground. It would also make the playground evaluate things differently from a regular SDK and I’m not sure that that’s something we want.

Instead, this change to the API makes the feature evaluate to 'unknown' or `false` (depending on constraints).
2022-08-05 11:09:55 +02:00
..
feature-evaluator Feat(#1873): return 'unknown' for application hostname strategies (#1889) 2022-08-05 11:09:55 +02:00
validators
anonymise.ts
arraysHaveSameItems.test.ts
arraysHaveSameItems.ts
collect-ids.ts
constants.ts
ensureStringValue.test.ts
ensureStringValue.ts
env.test.ts
env.ts
extract-user.ts
format-base-uri.test.ts
format-base-uri.ts
graceful-shutdown.ts
is-email.ts
isDefined.test.ts
isDefined.ts
load-index-html.ts
map-values.test.ts
map-values.ts
metrics-helper.ts
offline-unleash-client.test.ts Feat(#1873): return 'unknown' for application hostname strategies (#1889) 2022-08-05 11:09:55 +02:00
offline-unleash-client.ts feat(#1873/playground): Return detailed information on feature toggle evaluation (#1839) 2022-08-04 15:41:52 +02:00
omit-keys.test.ts
omit-keys.ts
random-id.ts
rewriteHTML.test.ts
rewriteHTML.ts
segments.ts
semver.test.ts
semver.ts
snakeCase.test.ts
snakeCase.ts
timer.test.ts
timer.ts
validateJsonString.test.ts
validateJsonString.ts
version.ts