posthog-node 4.5.1 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { createReadStream } from 'node:fs';
3
3
  import { createInterface } from 'node:readline';
4
4
  import { posix, dirname, sep } from 'node:path';
5
5
 
6
- var version = "4.5.1";
6
+ var version = "4.5.2";
7
7
 
8
8
  var PostHogPersistedProperty;
9
9
  (function (PostHogPersistedProperty) {
@@ -2996,8 +2996,12 @@ class PostHog extends PostHogCoreStateless {
2996
2996
  // return await super.getFeatureFlagsStateless(distinctId, groups, undefined, undefined, disableGeoip)
2997
2997
  return await _getFlags(distinctId, groups, disableGeoip);
2998
2998
  }
2999
+ if (event === '$feature_flag_called') {
3000
+ // If we're capturing a $feature_flag_called event, we don't want to enrich the event with cached flags that may be out of date.
3001
+ return {};
3002
+ }
2999
3003
  if ((this.featureFlagsPoller?.featureFlags?.length || 0) > 0) {
3000
- // Otherwise we may as well check for the flags locally and include them if there
3004
+ // Otherwise we may as well check for the flags locally and include them if they are already loaded
3001
3005
  const groupsWithStringValues = {};
3002
3006
  for (const [key, value] of Object.entries(groups || {})) {
3003
3007
  groupsWithStringValues[key] = String(value);