posthog-ruby 3.15.2 → 3.15.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87c4c21f1799cc12f7e4792f728194091a4e3abfe28fa26315469c43cbefd6ba
4
- data.tar.gz: 4fa4b2455dcf53c3e805616af1e5eb5ae266729f90832f4c4491147c6626f71d
3
+ metadata.gz: 36a73ef4ffe63b9e2c722441bd8d3c5732e8e162ea1431bdc68bc861b2c8a452
4
+ data.tar.gz: cf1f040865ce0df9fc7c68d0cac9f0903114b959b1b162d83afecfbdfe8697d1
5
5
  SHA512:
6
- metadata.gz: b1fce8fb104ff14b8564649222d729fdd6feda8d3382119eee8c034663108edb972932aaee7d17de6d87911816986e55236a554ce19ba107e032bc04f4fdab7d
7
- data.tar.gz: b95fecee03f14f695410f76230e8e1284286c4835cd8f4c2ef66779fc57a27bda7e7c3e892a989207ebd85d1f9531a6034a041dade066d776707ae03c7227661
6
+ metadata.gz: 5214a1df75497519ac214d1134549a9d41e98bb16ca7e82df800fca062957ecc17c382472902cd7a8161fe4a6a92786c2fe243ec10663dbbaeb7ae1ddd54562f
7
+ data.tar.gz: 3adf9801fe9b1a64427d8c7a0fd4abbc15b78c77fa80566e2be23bc97ff9d3d9808be9ba0513f71d00b814ae9e70da532e82495ce3c4bf763b00ac1adf30b076
@@ -558,7 +558,7 @@ module PostHog
558
558
  return FeatureFlagEvaluations.new(host: host, distinct_id: distinct_id, flags: {}, groups: groups) if @disabled
559
559
 
560
560
  person_properties, group_properties = add_local_person_and_group_properties(
561
- distinct_id, groups, person_properties, group_properties
561
+ groups, person_properties, group_properties
562
562
  )
563
563
 
564
564
  records = {}
@@ -672,8 +672,8 @@ module PostHog
672
672
  )
673
673
  return {} if @disabled
674
674
 
675
- person_properties, group_properties = add_local_person_and_group_properties(distinct_id, groups,
676
- person_properties, group_properties)
675
+ person_properties, group_properties = add_local_person_and_group_properties(groups, person_properties,
676
+ group_properties)
677
677
  @feature_flags_poller.get_all_flags(distinct_id, groups, person_properties, group_properties,
678
678
  only_evaluate_locally)
679
679
  end
@@ -712,8 +712,8 @@ module PostHog
712
712
  return nil if @disabled
713
713
 
714
714
  key = key.to_s
715
- person_properties, group_properties = add_local_person_and_group_properties(distinct_id, groups,
716
- person_properties, group_properties)
715
+ person_properties, group_properties = add_local_person_and_group_properties(groups, person_properties,
716
+ group_properties)
717
717
  @feature_flags_poller.get_feature_flag_payload(key, distinct_id, match_value, groups, person_properties,
718
718
  group_properties, only_evaluate_locally)
719
719
  end
@@ -740,7 +740,7 @@ module PostHog
740
740
  return { featureFlags: {}, featureFlagPayloads: {} } if @disabled
741
741
 
742
742
  person_properties, group_properties = add_local_person_and_group_properties(
743
- distinct_id, groups, person_properties, group_properties
743
+ groups, person_properties, group_properties
744
744
  )
745
745
  response = @feature_flags_poller.get_all_flags_and_payloads(
746
746
  distinct_id, groups, person_properties, group_properties, only_evaluate_locally
@@ -902,7 +902,7 @@ module PostHog
902
902
 
903
903
  key = key.to_s
904
904
  person_properties, group_properties = add_local_person_and_group_properties(
905
- distinct_id, groups, person_properties, group_properties
905
+ groups, person_properties, group_properties
906
906
  )
907
907
  feature_flag_response, flag_was_locally_evaluated, request_id, evaluated_at, feature_flag_error, payload =
908
908
  @feature_flags_poller.get_feature_flag(
@@ -1048,7 +1048,7 @@ module PostHog
1048
1048
  @shutdown_mutex.synchronize { @shutdown }
1049
1049
  end
1050
1050
 
1051
- def add_local_person_and_group_properties(distinct_id, groups, person_properties, group_properties)
1051
+ def add_local_person_and_group_properties(groups, person_properties, group_properties)
1052
1052
  groups ||= {}
1053
1053
  person_properties ||= {}
1054
1054
  group_properties ||= {}
@@ -1061,8 +1061,6 @@ module PostHog
1061
1061
  symbolize_keys! value
1062
1062
  end
1063
1063
 
1064
- all_person_properties = { distinct_id: distinct_id }.merge(person_properties)
1065
-
1066
1064
  all_group_properties = {}
1067
1065
  groups&.each do |group_name, group_key|
1068
1066
  all_group_properties[group_name] = {
@@ -1070,7 +1068,7 @@ module PostHog
1070
1068
  }.merge((group_properties && group_properties[group_name]) || {})
1071
1069
  end
1072
1070
 
1073
- [all_person_properties, all_group_properties]
1071
+ [person_properties, all_group_properties]
1074
1072
  end
1075
1073
  end
1076
1074
  end
@@ -922,7 +922,12 @@ module PostHog
922
922
 
923
923
  aggregation_group_type_index = flag_filters[:aggregation_group_type_index]
924
924
  if aggregation_group_type_index.nil?
925
- return match_feature_flag_properties(flag, distinct_id, person_properties, evaluation_cache, @cohorts,
925
+ local_person_properties = person_properties || {}
926
+ unless local_person_properties.key?(:distinct_id) || local_person_properties.key?('distinct_id')
927
+ local_person_properties = local_person_properties.merge(distinct_id: distinct_id)
928
+ end
929
+
930
+ return match_feature_flag_properties(flag, distinct_id, local_person_properties, evaluation_cache, @cohorts,
926
931
  groups: groups, group_properties: group_properties)
927
932
  end
928
933
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostHog
4
- VERSION = '3.15.2'
4
+ VERSION = '3.15.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posthog-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.15.2
4
+ version: 3.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''