-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat(feature-flags): v3 feature flag payloads #50
Conversation
Ah, another part that's missing here, is that we need to add the same handling for local evaluation as well |
Local eval for node suggestion: #54 |
Waiting on #53 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
newFeatureFlagPayloads = { ...currentFlagPayloads, ...res.featureFlagPayloads } | ||
} | ||
this.setKnownFeatureFlagPayloads(newFeatureFlagPayloads) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need upserting here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Actually, can we not duplicate upserting code and move it into the above? wherever flags are set, set the payloads as well, otherwise don't do anything.
Let's always keep flags response as the source of truth, and payloads just follow whatever happens to flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, will be easy to make these go out of sync, which is terrible :/
Thinking about this further, wherever we set Extending this thought further, sounds like we need to add payloads to bootstrapping as well, which makes sense 😅 - so a |
Two new functions based on PostHog/posthog#13580:
getFeatureFlagPayloads(): PostHogDecideResponse['featureFlagPayloads'] | undefined
— returns all matched flag payloadsgetFeatureFlagPayload(key:string): JsonType | undefined
— return only the payload of the flag requested in parameter