statsig 2.8.3 → 2.8.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: a17857d17823d2f8d7f6a13d01c4f3d117e4187233d377441c4e7be7a6499ef1
4
- data.tar.gz: 34bb6a509d1fca2ab2973edf7ce0f76814440c5197649a68af8c573130ef13d5
3
+ metadata.gz: 659ac849e7a883eb05f0a5bcfa2be82e2196c903f97cca9c39a74c5f6753458b
4
+ data.tar.gz: 1f2067256ddcc39b3fe078a6776e740d9eb3d3a82326c1a281a83832559fa9a6
5
5
  SHA512:
6
- metadata.gz: eef23c96fefa5aff93eec2ce8562a45ccb59434bfb68d264f39b50df987689c402286895103295b701ba6f71db970f43bd8832f608a2da0622a5bde1717d9521
7
- data.tar.gz: 7df3f01db686cf387e30b7d45be967be4d9376340d64506359c0df6a0a9b169f45ef310a7b727b34f87cb9c4ddb97f7ba0a80daf7e79d8102f256f83f32369cd
6
+ metadata.gz: 980fb1e0a8dbe70abc86a94f9cb09dccbf215809ae7079c9898d71cb854db86abb308c2b846c3617f8f6c28dadeaca999386459e6faecb82832de062ab47ac2b
7
+ data.tar.gz: 63fb183126f3df4648c7167a56cf53aee361ee1c2c68305c0855ee06cb982b4ae9c7e74c1f2ca786136a0ac04cf614519b38e616b43bfa324e6f0028a965704f
data/lib/network.rb CHANGED
@@ -50,12 +50,15 @@ module Statsig
50
50
  end
51
51
  end
52
52
 
53
- def download_config_specs(since_time)
53
+ def download_config_specs(since_time, context)
54
54
  url = @options.download_config_specs_url
55
55
  dcs_url = "#{url}#{@server_secret}.json"
56
56
  if since_time.positive?
57
57
  dcs_url += "?sinceTime=#{since_time}"
58
58
  end
59
+ if context == 'initialize'
60
+ return get(dcs_url, @options.initialize_retry_limit)
61
+ end
59
62
  get(dcs_url)
60
63
  end
61
64
 
@@ -81,8 +84,11 @@ module Statsig
81
84
 
82
85
  end
83
86
 
84
- def get_id_lists
87
+ def get_id_lists(context)
85
88
  url = @options.get_id_lists_url
89
+ if context == 'initialize'
90
+ return post(url, JSON.generate({ 'statsigMetadata' => Statsig.get_statsig_metadata }), @options.initialize_retry_limit)
91
+ end
86
92
  post(url, JSON.generate({ 'statsigMetadata' => Statsig.get_statsig_metadata }))
87
93
  end
88
94
 
data/lib/spec_store.rb CHANGED
@@ -291,7 +291,7 @@ module Statsig
291
291
  error = nil
292
292
  failure_details = nil
293
293
  begin
294
- response, e = @network.download_config_specs(@last_config_sync_time)
294
+ response, e = @network.download_config_specs(@last_config_sync_time, context)
295
295
  code = response&.status.to_i
296
296
  if e.is_a? NetworkError
297
297
  code = e.http_code
@@ -401,7 +401,7 @@ module Statsig
401
401
 
402
402
  def get_id_lists_from_network(context)
403
403
  tracker = @diagnostics.track(context, 'get_id_list_sources', 'network_request')
404
- response, e = @network.get_id_lists
404
+ response, e = @network.get_id_lists(context)
405
405
  code = response&.status.to_i
406
406
  if e.is_a? NetworkError
407
407
  code = e.http_code
data/lib/statsig.rb CHANGED
@@ -410,7 +410,7 @@ module Statsig
410
410
  def self.get_statsig_metadata
411
411
  {
412
412
  'sdkType' => 'ruby-server',
413
- 'sdkVersion' => '2.8.3',
413
+ 'sdkVersion' => '2.8.4',
414
414
  'languageVersion' => RUBY_VERSION
415
415
  }
416
416
  end
@@ -92,6 +92,10 @@ class StatsigOptions
92
92
  # default: false
93
93
  attr_accessor :disable_evaluation_memoization
94
94
 
95
+ # Number of times to retry fetching rulesets and id lists on initialization.
96
+ # default: 0
97
+ attr_accessor :initialize_retry_limit
98
+
95
99
  def initialize(
96
100
  environment = nil,
97
101
  download_config_specs_url: nil,
@@ -115,7 +119,8 @@ class StatsigOptions
115
119
  post_logs_retry_limit: 3,
116
120
  post_logs_retry_backoff: nil,
117
121
  user_persistent_storage: nil,
118
- disable_evaluation_memoization: false
122
+ disable_evaluation_memoization: false,
123
+ initialize_retry_limit: 0
119
124
  )
120
125
  @environment = environment.is_a?(Hash) ? environment : nil
121
126
 
@@ -146,5 +151,6 @@ class StatsigOptions
146
151
  @post_logs_retry_backoff = post_logs_retry_backoff
147
152
  @user_persistent_storage = user_persistent_storage
148
153
  @disable_evaluation_memoization = disable_evaluation_memoization
154
+ @initialize_retry_limit = initialize_retry_limit
149
155
  end
150
156
  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.8.3
4
+ version: 2.8.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: 2026-01-26 00:00:00.000000000 Z
11
+ date: 2026-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler