Skip to content

Difficult to differentiate between old default, updated default and user set value #309

@mohlson

Description

@mohlson

Hi! We have a bit of a conundrum.

When requesting a Toggle the first time, it will store itself with a default value. Any subsequent request to that toggle will then reply with the same stored value, regardless of any new default passed. As there is no way to determine if the value actually comes from an old default or from a user actively toggling the toggle, it becomes difficult to update the default.

Here is a a scenario

  1. A query for the Boolean Toggle for key "thought-experiment-A-roll-out" is added in a client application with default set to the value of the feature flag, which is false as the feature has not yet been rolled out.
  2. The feature is rolled-out to the test environment, and trying to respect the user's wishes, we check the toggle, using the updated value of the feature flag as the default parameter to Toggles.
  3. Toggles fetches the old default value, and since we have a return value, the new default is simply discarded. Now we cannot determine if the returned value is an old default or something the local developer has set, so we also have to discard the new default.

Maybe it would be possible to separate a Toggle's value from its default value, and to always update the default it it no longer matches?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions