-
Notifications
You must be signed in to change notification settings - Fork 99
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(flags): Allow adding person and group property overrides for flags #613
Conversation
Size Change: +7.08 kB (0%) Total Size: 2.3 MB
ℹ️ View Unchanged
|
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.
lgtm besides naming
src/posthog-core.ts
Outdated
* This is used when dealing with new persons / where you don't want to wait for ingestion | ||
* to update user properties. | ||
*/ | ||
personPropertiesForFlags(properties: Properties, reloadFeatureFlags = true): void { |
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.
Naming on these functions could be better. They sound like getters
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.
setPersonPropertiesForFlags
?
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.
yep
One extra thought: would it not be better to have a general "override person properties" function that does the same thing just makes it more clear you're overriding person/group properties for this person/group in focus. Or maybe even just do this implicitly if user/group properties are ever set. Just trying to think how to make this clearer because all the overridability makes the experience pretty confusing. Now there's more concepts—bootstrapping, local evaluation, and person/group overrides |
Not sure what you mean by 'this person/group in focus'. Isn't it already doing that? It's implicitly adding props for current person/group, when they're passed in.
Agree. On the bright-ish side, most people shouldn't have to use this - it works out of the box, it's only for some special use-cases, where you're not setting person properties but want them to be used for flags, that this comes into the picture. It's somewhat like local evaluation, but in client-side SDKs, where you're again passing in properties to evaluate. |
Changes
When you want properties to be reflected immediately for feature flags, you can now use these functions to override server properties & not wait for ingestion to resolve flags.
Docs here: PostHog/posthog.com#5827
...
Checklist