Skip to content

feat: parse flag values strictly in built-in providers - #5

Merged
aubes merged 1 commit into
mainfrom
feature/cast-type
Sep 28, 2026
Merged

aubes merged 1 commit into
mainfrom
feature/cast-type

Conversation

@aubes

@aubes aubes commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Built-in providers no longer cast flag values silently:

  • EnvVarProvider and RedisProvider parse raw values strictly. An invalid value (e.g. "banana" as boolean, "10.0" as integer) now returns the default value with PARSE_ERROR, instead of being cast.
  • InMemoryProvider returns TYPE_MISMATCH when the YAML type does not match the requested type. The only accepted conversions are 0/1 as boolean and integers as float, like typed providers such as flagd.
  • ResolutionDetailsTrait::toBool() is replaced by parseBool(), parseInt(), parseFloat() and parseObject().
  • RedisProvider now logs client failures at error level. Previously, a Redis outage silently resolved every flag to its default value.

The docs list the accepted values per type for each provider.

@aubes
aubes merged commit 33e11c6 into main Sep 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant