statsig 2.5.2 → 2.5.4
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 +4 -4
- data/lib/client_initialize_helpers.rb +10 -16
- data/lib/evaluator.rb +4 -2
- data/lib/statsig.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18141eb6b0169f1e1f2a1cb9fac6a249b49c422bab8ced2c7dc09de0a023c2ce
|
4
|
+
data.tar.gz: 7328411125b434f4e90c8e9900f2f6a9cd5fb811a9089ed677e3cf248f23bb73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a022ec077aa7ae5e661add0ba003cca65b74521de6f2da467322913a267a47376c2e6a52474b97bab634be0a00e7a0a0cbc9d385a8b8718f3478a46d28fc4045
|
7
|
+
data.tar.gz: b33efac15e9d651b47140fdeb299188fd0df2a23865014de309f13178e33f11363da0bf766c08b7b8ec2f941984d800929e1ed69b7543286a89e7f7aeecc5bbd
|
@@ -31,7 +31,6 @@ module Statsig
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.to_response(config_name, config_spec, evaluator, user, client_sdk_key, hash_algo, include_exposures, include_local_overrides)
|
34
|
-
config_name_str = config_name.to_s
|
35
34
|
category = config_spec[:type]
|
36
35
|
entity_type = config_spec[:entity]
|
37
36
|
if entity_type == Const::TYPE_SEGMENT || entity_type == Const::TYPE_HOLDOUT
|
@@ -47,6 +46,7 @@ module Statsig
|
|
47
46
|
end
|
48
47
|
end
|
49
48
|
|
49
|
+
config_name_str = config_name.to_s
|
50
50
|
if local_override.nil?
|
51
51
|
eval_result = ConfigResult.new(
|
52
52
|
name: config_name,
|
@@ -124,14 +124,6 @@ module Statsig
|
|
124
124
|
|
125
125
|
result[:is_in_layer] = true
|
126
126
|
result[:explicit_parameters] = config_spec[:explicitParameters] || []
|
127
|
-
|
128
|
-
layer_name = evaluator.spec_store.experiment_to_layer[config_name]
|
129
|
-
if layer_name.nil? || evaluator.spec_store.layers[layer_name].nil?
|
130
|
-
return
|
131
|
-
end
|
132
|
-
|
133
|
-
layer = evaluator.spec_store.layers[layer_name]
|
134
|
-
result[:value] = layer[:defaultValue].merge(result[:value])
|
135
127
|
end
|
136
128
|
|
137
129
|
def self.populate_layer_fields(config_spec, eval_result, result, evaluator, hash_algo, include_exposures)
|
@@ -153,13 +145,15 @@ module Statsig
|
|
153
145
|
end
|
154
146
|
|
155
147
|
def self.hash_name(name, hash_algo)
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
148
|
+
Statsig::Memo.for_global(:hash_name, "#{hash_algo}|#{name}") do
|
149
|
+
case hash_algo
|
150
|
+
when Statsig::Const::NONE
|
151
|
+
name
|
152
|
+
when Statsig::Const::DJB2
|
153
|
+
Statsig::HashUtils.djb2(name)
|
154
|
+
else
|
155
|
+
Statsig::HashUtils.sha256(name)
|
156
|
+
end
|
163
157
|
end
|
164
158
|
end
|
165
159
|
end
|
data/lib/evaluator.rb
CHANGED
@@ -103,6 +103,7 @@ module Statsig
|
|
103
103
|
end
|
104
104
|
|
105
105
|
if @spec_store.init_reason == EvaluationReason::UNINITIALIZED
|
106
|
+
end_result.gate_value = false
|
106
107
|
unless end_result.disable_evaluation_details
|
107
108
|
end_result.evaluation_details = EvaluationDetails.uninitialized
|
108
109
|
end
|
@@ -422,6 +423,7 @@ module Statsig
|
|
422
423
|
|
423
424
|
def unsupported_or_unrecognized(config_name, end_result)
|
424
425
|
end_result.rule_id = Const::EMPTY_STR
|
426
|
+
end_result.gate_value = false
|
425
427
|
|
426
428
|
if end_result.disable_evaluation_details
|
427
429
|
return
|
@@ -613,11 +615,11 @@ module Statsig
|
|
613
615
|
eval_condition(user, condition, end_result)
|
614
616
|
end
|
615
617
|
|
616
|
-
if !@options.disable_evaluation_memoization &&
|
618
|
+
if !@options.disable_evaluation_memoization &&
|
617
619
|
condition && condition[:type] != Const::CND_PASS_GATE && condition[:type] != Const::CND_FAIL_GATE
|
618
620
|
eval_rule_memo[condition_hash] = result
|
619
621
|
end
|
620
|
-
|
622
|
+
|
621
623
|
memo[:eval_rule] = eval_rule_memo
|
622
624
|
|
623
625
|
pass = false if result != true
|
data/lib/statsig.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Statsig, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|