posthog-node 5.28.1 → 5.28.3

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/dist/client.js CHANGED
@@ -541,7 +541,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
541
541
  }
542
542
  async _shutdown(shutdownTimeoutMs) {
543
543
  const resolve = this._consumeWaitUntilCycle();
544
- this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
544
+ await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
545
545
  this.errorTracking.shutdown();
546
546
  try {
547
547
  return await super._shutdown(shutdownTimeoutMs);
@@ -664,7 +664,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
664
664
  async captureExceptionImmediate(error, distinctId, additionalProperties) {
665
665
  if (!index_js_default().isPreviouslyCapturedError(error)) {
666
666
  const syntheticException = new Error('PostHog syntheticException');
667
- this.addPendingPromise(index_js_default().buildEventMessage(error, {
667
+ return this.addPendingPromise(index_js_default().buildEventMessage(error, {
668
668
  syntheticException
669
669
  }, distinctId, additionalProperties).then((msg)=>this.captureImmediate(msg)));
670
670
  }
package/dist/client.mjs CHANGED
@@ -503,7 +503,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
503
503
  }
504
504
  async _shutdown(shutdownTimeoutMs) {
505
505
  const resolve = this._consumeWaitUntilCycle();
506
- this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
506
+ await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
507
507
  this.errorTracking.shutdown();
508
508
  try {
509
509
  return await super._shutdown(shutdownTimeoutMs);
@@ -626,7 +626,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
626
626
  async captureExceptionImmediate(error, distinctId, additionalProperties) {
627
627
  if (!error_tracking.isPreviouslyCapturedError(error)) {
628
628
  const syntheticException = new Error('PostHog syntheticException');
629
- this.addPendingPromise(error_tracking.buildEventMessage(error, {
629
+ return this.addPendingPromise(error_tracking.buildEventMessage(error, {
630
630
  syntheticException
631
631
  }, distinctId, additionalProperties).then((msg)=>this.captureImmediate(msg)));
632
632
  }
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const version = "5.28.1";
1
+ export declare const version = "5.28.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -26,7 +26,7 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  version: ()=>version
28
28
  });
29
- const version = '5.28.1';
29
+ const version = '5.28.3';
30
30
  exports.version = __webpack_exports__.version;
31
31
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
32
32
  "version"
package/dist/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- const version = '5.28.1';
1
+ const version = '5.28.3';
2
2
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-node",
3
- "version": "5.28.1",
3
+ "version": "5.28.3",
4
4
  "description": "PostHog Node.js integration",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,9 +25,10 @@
25
25
  "module": "dist/entrypoints/index.node.mjs",
26
26
  "types": "dist/entrypoints/index.node.d.ts",
27
27
  "dependencies": {
28
- "@posthog/core": "1.23.3"
28
+ "@posthog/core": "1.23.4"
29
29
  },
30
30
  "devDependencies": {
31
+ "@edge-runtime/jest-environment": "^4.0.0",
31
32
  "@rslib/core": "0.10.6",
32
33
  "@types/express": "^5.0.5",
33
34
  "@types/jest": "^29.5.14",
@@ -96,6 +97,7 @@
96
97
  "lint": "eslint src",
97
98
  "lint:fix": "eslint src --fix",
98
99
  "test:unit": "jest",
100
+ "test:edge-compat": "jest --env @edge-runtime/jest-environment --no-coverage",
99
101
  "prebuild": "node -p \"'export const version = \\'' + require('./package.json').version + '\\''\" > src/version.ts",
100
102
  "build": "rslib build",
101
103
  "dev": "rslib build -w",
package/src/client.ts CHANGED
@@ -1699,7 +1699,7 @@ export abstract class PostHogBackendClient extends PostHogCoreStateless implemen
1699
1699
  // Cancel any pending debounced flush — shutdown will flush directly.
1700
1700
  const resolve = this._consumeWaitUntilCycle()
1701
1701
 
1702
- this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs)
1702
+ await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs)
1703
1703
  this.errorTracking.shutdown()
1704
1704
  try {
1705
1705
  return await super._shutdown(shutdownTimeoutMs)
@@ -1970,7 +1970,7 @@ export abstract class PostHogBackendClient extends PostHogCoreStateless implemen
1970
1970
  ): Promise<void> {
1971
1971
  if (!ErrorTracking.isPreviouslyCapturedError(error)) {
1972
1972
  const syntheticException = new Error('PostHog syntheticException')
1973
- this.addPendingPromise(
1973
+ return this.addPendingPromise(
1974
1974
  ErrorTracking.buildEventMessage(error, { syntheticException }, distinctId, additionalProperties).then((msg) =>
1975
1975
  this.captureImmediate(msg)
1976
1976
  )
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '5.28.1'
1
+ export const version = '5.28.3'