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: new strategy using default strategy #7075

Merged
merged 3 commits into from
May 20, 2024

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented May 17, 2024

About the changes

First click on add strategy didn't respect the default strategy. Subsequent ones did. The reason for that is useEffect didn't observe the default strategy being updated from no strategy to actual strategy from the API.

Also, updated useProject to useProjectOverview which is part of the useProject deprecation. They are almost the same. The only difference is project overview doesn't read all project features which we don't need here to read env default strategy.

Important files

Discussion points

Since we're observing all changes to the default strategy it means that if I'm editing a strategy and the default project environment strategy changes my edits are erased and I have to start from scratch. I'm assuming that default strategy changes are so rare it shouldn't be a problem and more complex logic is not justified.

Copy link

vercel bot commented May 17, 2024

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 May 17, 2024 10:18am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview May 17, 2024 10:18am

@@ -119,6 +119,7 @@ export const FeatureStrategyCreate = () => {
}, [
featureId,
JSON.stringify(strategyDefinition),
JSON.stringify(defaultStrategy),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a fix for the bug

@kwasniew kwasniew requested a review from sjaanus May 20, 2024 07:34
@kwasniew kwasniew merged commit 50ee7fa into main May 20, 2024
10 checks passed
@kwasniew kwasniew deleted the fix-new-strategy-uses-default-strategy branch May 20, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants