Repository navigation
fix(openfeature-web): reject blank numeric flag variants - #5621
Open
peterolkhov wants to merge 1 commit into
Open
peterolkhov wants to merge 1 commit into
peterolkhov wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A blank variant becomes
0throughNumber(variant), sogetNumberDetails('flag', 42)silently returns zero instead of the caller's default. The Node provider already rejects blank variants; its original PR explicitly left the web equivalent for a follow-up.Changes
Match the Node guard in the web provider. Empty and whitespace-only variants now produce
TYPE_MISMATCH, letting OpenFeature return the caller's default; valid numeric variants, including'0', keep working. Added provider-level cases and regressions through the real OpenFeature client, plus a patch changeset.Validation on Node 24.13.0:
pnpm turbo run test:unit check-types lint build --filter=@posthog/openfeature-web-provider --concurrency=2passed, including prerequisite builds.pnpm format,pnpm lint:oxlint,pnpm lint:playground, changeset status, andgit diff --checkpassed.The full monorepo build, type-check, and test matrices were not run; dependency installation was limited to the provider's workspace graph and root tools.
Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted). Peter Olkhovets (
@peterolkhov) directed the contribution and is the DRI.Prepared with Codex using GPT-6.1 Sol at high reasoning, shell/GitHub CLI for source and PR inspection, and pnpm/Vitest/Oxfmt for local validation. Session: local Codex session, not publicly shared.
The existing Node guard and the deferred web follow-up established the intended behavior. The change stays in the numeric adapter; it adds no public options, dependencies, or broader parsing rules. Human review is still required before merge.
DRI: @peterolkhov. Repository permissions prevent this account from setting its own assignee; a maintainer will need to set the assignment.