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

feat(flags): Add local props and flags to all calls #149

Merged
merged 22 commits into from
Jan 9, 2024
Merged

Conversation

neilkakkar
Copy link
Contributor

@neilkakkar neilkakkar commented Dec 26, 2023

Problem

Copy of PostHog/posthog-python#106

This turned out to be a lot trickier than expected, because I noticed a few issues. With the sendFeatureFlags capture option, it seems like we were dropping events, since on shutdown the feature flag promises aren't tracked for populating flag information, which means the capture is not enqueued.

I can't yet think of a better way to solve this right now, so we just start tracking flag promises from within capture as well, annnd flush again on shutdown after pending promises have resolved, to make sure all new capture events queued are sent as well.

I'm also moving a few more things that should've been based on the onError emitter, and fixed tests that incorrectly assumed this was working fine.

(cc: @marandaneto @benjackwhite have a look here too please?)

Changes

Release info Sub-libraries affected

Bump level

  • Major
  • Minor
  • Patch

Libraries affected

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Changelog notes

  • Added support for X

@neilkakkar
Copy link
Contributor Author

Missing a test for adding default properties to all flag functions

@neilkakkar
Copy link
Contributor Author

neilkakkar commented Jan 5, 2024

oh much nicer, thanks!! 😓

@neilkakkar neilkakkar enabled auto-merge (squash) January 9, 2024 13:15
@neilkakkar neilkakkar merged commit 20ea30d into main Jan 9, 2024
2 of 3 checks passed
@neilkakkar neilkakkar deleted the local-props branch January 9, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants