statsig 1.13.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 898237740392ece6cde365fd111e6d49daacac47d39317f06435fbfe83df8821
4
- data.tar.gz: 6075c3333c37aeb94fc24511cea4bb6f1a7689c23d05100c91f9a9afc8525393
3
+ metadata.gz: 2536756538598d9f75c2b8920c90b7be1ab91ab05b416aedb5b05f325a6f5fde
4
+ data.tar.gz: 045e5cc822c2355b5fd4c1cb9386425df3d85930c3f56735f96816b2242ae3a7
5
5
  SHA512:
6
- metadata.gz: ee1eb3fec70c73522532f44255ef065b2d286382645ad7988cad9d297295548a97f18a50b5f73a046e6987fadbff3184f53a91cbb9f969b805c1cb1681552454
7
- data.tar.gz: d3818d3492d50cd9da8cdf2f8067140383c25b1d124d205a47303023fb64a10e1f5424fcf08e8b8270c3c7e96a88ee088fa2abc1c8a91918c550dcc280fc7778
6
+ metadata.gz: 39494460ee50c89666dad6962a023dc7a954a24d386621855d219789a749e8ae58c40f19f4c8f472c46e5d3df33e28d5e3e05b9e44ccbf6569560353ae34670c
7
+ data.tar.gz: 24b455140fcd7a4d628ce3780d19ee0ce7824fe41b799f39a015c8cf98f5124796d060f27ff65b353c0c9895fbadb6add845c2b09a3b0d3b2d68c3c8810a30be
data/lib/evaluator.rb CHANGED
@@ -92,6 +92,15 @@ module Statsig
92
92
 
93
93
  formatter = ClientInitializeHelpers::ResponseFormatter.new(self, user)
94
94
 
95
+ evaluated_keys = {}
96
+ if user.user_id.nil? == false
97
+ evaluated_keys['userID'] = user.user_id
98
+ end
99
+
100
+ if user.custom_ids.nil? == false
101
+ evaluated_keys['customIDs'] = user.custom_ids
102
+ end
103
+
95
104
  {
96
105
  "feature_gates" => formatter.get_responses(:gates),
97
106
  "dynamic_configs" => formatter.get_responses(:configs),
@@ -99,6 +108,7 @@ module Statsig
99
108
  "sdkParams" => {},
100
109
  "has_updates" => true,
101
110
  "generator" => "statsig-ruby-sdk",
111
+ "evaluated_keys" => evaluated_keys,
102
112
  "time" => 0,
103
113
  }
104
114
  end
data/lib/network.rb CHANGED
@@ -66,7 +66,7 @@ module Statsig
66
66
  def post_logs(events)
67
67
  begin
68
68
  json_body = JSON.generate({'events' => events, 'statsigMetadata' => Statsig.get_statsig_metadata})
69
- post_helper('log_event', json_body, retries: 5)
69
+ post_helper('log_event', json_body, 5)
70
70
  rescue
71
71
  end
72
72
  end
data/lib/statsig.rb CHANGED
@@ -61,7 +61,7 @@ module Statsig
61
61
  def self.get_statsig_metadata
62
62
  {
63
63
  'sdkType' => 'ruby-server',
64
- 'sdkVersion' => '1.13.0',
64
+ 'sdkVersion' => '1.14.0',
65
65
  }
66
66
  end
67
67
 
@@ -94,7 +94,13 @@ module Statsig
94
94
  @events = []
95
95
  flush_events = events_clone.map { |e| e.serialize }
96
96
 
97
- @network.post_logs(flush_events)
97
+ if closing
98
+ @network.post_logs(flush_events)
99
+ else
100
+ Thread.new do
101
+ @network.post_logs(flush_events)
102
+ end
103
+ end
98
104
  end
99
105
 
100
106
  def maybe_restart_background_threads
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: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Statsig, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-20 00:00:00.000000000 Z
11
+ date: 2022-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  - !ruby/object:Gem::Version
156
156
  version: '0'
157
157
  requirements: []
158
- rubygems_version: 3.2.3
158
+ rubygems_version: 3.3.11
159
159
  signing_key:
160
160
  specification_version: 4
161
161
  summary: Statsig server SDK for Ruby