posthog-node 5.8.5 → 5.8.7

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.
@@ -745,7 +745,7 @@ class ErrorTracking {
745
745
  this.client.addPendingPromise((async () => {
746
746
  const eventMessage = await ErrorTracking.buildEventMessage(exception, hint);
747
747
  const exceptionProperties = eventMessage.properties;
748
- const exceptionType = exceptionProperties?.$exception_list[0].type ?? 'Exception';
748
+ const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? 'Exception';
749
749
  const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
750
750
  if (isRateLimited) {
751
751
  this._logger.info('Skipping exception capture because of client rate limiting.', {
@@ -1189,7 +1189,7 @@ function snipLine(line, colno) {
1189
1189
  return newLine;
1190
1190
  }
1191
1191
 
1192
- var version = "5.8.5";
1192
+ var version = "5.8.7";
1193
1193
 
1194
1194
  /**
1195
1195
  * A lazy value that is only computed when needed. Inspired by C#'s Lazy<T> class.
@@ -1549,22 +1549,7 @@ class FeatureFlagsPoller {
1549
1549
  const flagConditions = flagFilters.groups || [];
1550
1550
  let isInconclusive = false;
1551
1551
  let result = undefined;
1552
- // # Stable sort conditions with variant overrides to the top. This ensures that if overrides are present, they are
1553
- // # evaluated first, and the variant override is applied to the first matching condition.
1554
- const sortedFlagConditions = [...flagConditions].sort((conditionA, conditionB) => {
1555
- const AHasVariantOverride = !!conditionA.variant;
1556
- const BHasVariantOverride = !!conditionB.variant;
1557
- if (AHasVariantOverride && BHasVariantOverride) {
1558
- return 0;
1559
- } else if (AHasVariantOverride) {
1560
- return -1;
1561
- } else if (BHasVariantOverride) {
1562
- return 1;
1563
- } else {
1564
- return 0;
1565
- }
1566
- });
1567
- for (const condition of sortedFlagConditions) {
1552
+ for (const condition of flagConditions) {
1568
1553
  try {
1569
1554
  if (await this.isConditionMatch(flag, distinctId, condition, properties, evaluationCache)) {
1570
1555
  const variantOverride = condition.variant;