Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sync enabled and variant status #4345

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Jul 26, 2023

About the changes

When we have non 100% gradual rollout with random stickiness enabled status and variant value were getting out of sync. This was because variant is checking isEnabled under the hood. In the new version we also verify isEnabled result (than contains enabled strategy variant). The new force version accepts the explicit evaluation result instead of a boolean flag.

Important files

Discussion points

@sonatype-lift
Copy link

sonatype-lift bot commented Jul 26, 2023

Sonatype Lift is retiring

Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

@vercel
Copy link

vercel bot commented Jul 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2023 9:21am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jul 26, 2023 9:21am

@@ -176,7 +176,11 @@ export class PlaygroundService {
data: strategyEvaluationResult.strategies,
},
projectId: featureProject[feature.name],
variant: client.getVariant(feature.name, clientContext),
variant: client.forceGetVariant(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're forcing variant to the strategy evaluation result

@@ -104,13 +104,18 @@ export class FeatureEvaluator {

forceGetVariant(
name: string,
forcedResults: Pick<
Copy link
Contributor Author

Choose a reason for hiding this comment

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

explicit value to force it to

@kwasniew kwasniew requested review from Tymek and sighphyre July 26, 2023 09:27
Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

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

Super nice catch, LGTM

@kwasniew kwasniew merged commit 9f35c21 into main Jul 26, 2023
18 checks passed
@kwasniew kwasniew deleted the fix-playground-variant-synced-with-enabled branch July 26, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants