fix(experiments): Avoid overriding feature flag payloads #27102
Merged
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.
See https://posthog.slack.com/archives/C07Q2U4BH4L/p1734548216860989
Changes
Moves
DistributionModal
update logic to a standaloneupdateDistributionModal()
method where we can wait to runupdateExperiment()
after the feature flags API call.This PR reverts #26772, which introduced this problem. The underlying problem is that including
parameters
in the request will override any existing feature flag information that isn't present in the request.Hope that this is an even less worse fix.
How did you test this code?
I reproduced the original issue and then verified this approach fixes it.
Original issue
CleanShot.2024-12-20.at.05.06.55.mp4
Fix applied
CleanShot.2024-12-20.at.05.05.20.mp4