Skip to content

Conversation

@thomasheartman
Copy link
Contributor

Fixes an edge case in the flag resolver, where if you call isEnabled for a variant flag, but the flag returns a disabled (or default) variant (but its feature is enabled), then the flag should still be "enabled" if feature_enabled is true.

@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Updated (UTC)
unleash-docs Ignored Ignored Nov 10, 2025 9:32am

@github-actions
Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

if (exp) {
if (typeof exp === 'boolean') return exp;
else if (exp.enabled) return exp.enabled;
else if (exp.enabled || exp.feature_enabled) return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int he experimental.file we have enabled not feature_enabled. I was adding this line here: #10607

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. this is one example where we have enabled field only and my change was addressing what we actually do in the experimenta.ts

   streaming: {
        name: 'disabled',
        enabled: parseEnvVarBoolean(
            process.env.UNLEASH_EXPERIMENTAL_STREAMING,
            false,
        ),
    },

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what we do, but the type is:

export interface Variant {
    name: string;
    enabled: boolean;
    payload?: Payload;
    feature_enabled?: boolean;
}

So we still allow you to have a feature_enabled field. We just don't treat it the same way that the regular unleash client does.

@github-project-automation github-project-automation bot moved this from New to Approved PRs in Issues and PRs Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

3 participants