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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4a6d7a7d78f225ba3becd4a89c120f84be707306bb30067c99d20ba5e82e38f
4
- data.tar.gz: 1714c16d5fa434cda47e3f0d7ed94510fd4f6d9892720d86e83103712dd73f6d
3
+ metadata.gz: 18141eb6b0169f1e1f2a1cb9fac6a249b49c422bab8ced2c7dc09de0a023c2ce
4
+ data.tar.gz: 7328411125b434f4e90c8e9900f2f6a9cd5fb811a9089ed677e3cf248f23bb73
5
5
  SHA512:
6
- metadata.gz: 7f01522fd0fa7dd567aa08fb0f363170ba310ec65ad56f22cdbe3b827911e948feaeb81e8d578a85b2b4210cb8abd61d01e01a0744ff3ea0a901ccfc5fa315ce
7
- data.tar.gz: 64dd4358abc8168ebaac7b26e5859f29e45a41a2c02a6b8dcf63e8696a54de70d50da1f9bce3fe095250e7c4eb63e4012dada16d06e47955e19983b73932537c
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
- case hash_algo
157
- when Statsig::Const::NONE
158
- return name
159
- when Statsig::Const::DJB2
160
- return Statsig::HashUtils.djb2(name)
161
- else
162
- return Statsig::HashUtils.sha256(name)
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
@@ -386,7 +386,7 @@ module Statsig
386
386
  def self.get_statsig_metadata
387
387
  {
388
388
  'sdkType' => 'ruby-server',
389
- 'sdkVersion' => '2.5.2',
389
+ 'sdkVersion' => '2.5.4',
390
390
  'languageVersion' => RUBY_VERSION
391
391
  }
392
392
  end
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.2
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-09 00:00:00.000000000 Z
11
+ date: 2025-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler