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/CHANGELOG.md +6 -0
- package/lib/index.cjs.js +6 -2
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +6 -2
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/posthog-node.ts +6 -1
- package/test/feature-flags.spec.ts +79 -0
- package/test/posthog-node.spec.ts +3 -1
package/CHANGELOG.md
CHANGED
package/lib/index.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var node_fs = require('node:fs');
|
|
|
7
7
|
var node_readline = require('node:readline');
|
|
8
8
|
var node_path = require('node:path');
|
|
9
9
|
|
|
10
|
-
var version = "4.5.
|
|
10
|
+
var version = "4.5.2";
|
|
11
11
|
|
|
12
12
|
var PostHogPersistedProperty;
|
|
13
13
|
(function (PostHogPersistedProperty) {
|
|
@@ -3000,8 +3000,12 @@ class PostHog extends PostHogCoreStateless {
|
|
|
3000
3000
|
// return await super.getFeatureFlagsStateless(distinctId, groups, undefined, undefined, disableGeoip)
|
|
3001
3001
|
return await _getFlags(distinctId, groups, disableGeoip);
|
|
3002
3002
|
}
|
|
3003
|
+
if (event === '$feature_flag_called') {
|
|
3004
|
+
// 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.
|
|
3005
|
+
return {};
|
|
3006
|
+
}
|
|
3003
3007
|
if ((this.featureFlagsPoller?.featureFlags?.length || 0) > 0) {
|
|
3004
|
-
// Otherwise we may as well check for the flags locally and include them if
|
|
3008
|
+
// Otherwise we may as well check for the flags locally and include them if they are already loaded
|
|
3005
3009
|
const groupsWithStringValues = {};
|
|
3006
3010
|
for (const [key, value] of Object.entries(groups || {})) {
|
|
3007
3011
|
groupsWithStringValues[key] = String(value);
|