splitclient-rb 8.11.0.pre.rc3 → 8.11.0
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/splitclient-rb/cache/repositories/segments_repository.rb +1 -0
- data/lib/splitclient-rb/engine/auth_api_client.rb +2 -6
- data/lib/splitclient-rb/engine/events/events_manager.rb +8 -8
- data/lib/splitclient-rb/engine/models/sdk_internal_event_notification.rb +6 -8
- data/lib/splitclient-rb/engine/sync_manager.rb +1 -5
- data/lib/splitclient-rb/sse/workers/splits_worker.rb +2 -6
- data/lib/splitclient-rb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41d269b5dc5e38906001aefe42cb60bb4ef8de5376b9d71c613b5c8345cc9451
|
|
4
|
+
data.tar.gz: 6d66df400c0e2279ac23250dc22540135bd4e358467b5ba17ade47f8efdc6be9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fd4c042221d85b902894870073ec8dda740807f59348c83ce470e5571d929b6e4ca88d19e014c597a91841464a89b4f3c558b35993f091b2d5bc142dc0bfb0e
|
|
7
|
+
data.tar.gz: b1bb37265463a9a8023f70cce31dbc880a2a84c0618b3defc4e0bef9075bb62cc558f68f212e9ea1b4310be51d180a1f5538333b6b30a2e079ce704fd4da638d
|
|
@@ -23,6 +23,7 @@ module SplitIoClient
|
|
|
23
23
|
name = segment[:name]
|
|
24
24
|
|
|
25
25
|
@adapter.initialize_set(segment_data(name)) unless @adapter.exists?(segment_data(name))
|
|
26
|
+
@config.logger.debug(segment)
|
|
26
27
|
add_keys(name, segment[:added])
|
|
27
28
|
remove_keys(name, segment[:removed])
|
|
28
29
|
if segment[:added].length > 0 || segment[:removed].length > 0
|
|
@@ -21,9 +21,7 @@ module SplitIoClient
|
|
|
21
21
|
return process_error(response) if response.status >= 400 && response.status < 500
|
|
22
22
|
|
|
23
23
|
@telemetry_runtime_producer.record_sync_error(Telemetry::Domain::Constants::TOKEN_SYNC, response.status.to_i)
|
|
24
|
-
if @config.debug_enabled
|
|
25
|
-
@config.logger.debug("Error connecting to: #{@config.auth_service_url}. Response status: #{response.status}")
|
|
26
|
-
end
|
|
24
|
+
@config.logger.debug("Error connecting to: #{@config.auth_service_url}. Response status: #{response.status}") if @config.debug_enabled
|
|
27
25
|
{ push_enabled: false, retry: true }
|
|
28
26
|
rescue StandardError => e
|
|
29
27
|
@config.logger.debug("AuthApiClient error: #{e.inspect}.") if @config.debug_enabled
|
|
@@ -53,9 +51,7 @@ module SplitIoClient
|
|
|
53
51
|
end
|
|
54
52
|
|
|
55
53
|
def process_error(response)
|
|
56
|
-
if @config.debug_enabled
|
|
57
|
-
@config.logger.debug("Error connecting to: #{@config.auth_service_url}. Response status: #{response.status}")
|
|
58
|
-
end
|
|
54
|
+
@config.logger.debug("Error connecting to: #{@config.auth_service_url}. Response status: #{response.status}") if @config.debug_enabled
|
|
59
55
|
@telemetry_runtime_producer.record_auth_rejections if response.status == 401
|
|
60
56
|
|
|
61
57
|
{ push_enabled: false, retry: false }
|
|
@@ -18,15 +18,15 @@ module SplitIoClient
|
|
|
18
18
|
|
|
19
19
|
@mutex.synchronize do
|
|
20
20
|
# SDK ready already fired
|
|
21
|
-
if sdk_event == Engine::Models::SdkEvent::SDK_READY && event_already_triggered(sdk_event)
|
|
22
|
-
@active_subscriptions[sdk_event] = Engine::Models::EventActiveSubscriptions.new(true, event_handler)
|
|
21
|
+
if sdk_event == SplitIoClient::Engine::Models::SdkEvent::SDK_READY && event_already_triggered(sdk_event)
|
|
22
|
+
@active_subscriptions[sdk_event] = SplitIoClient::Engine::Models::EventActiveSubscriptions.new(true, event_handler)
|
|
23
23
|
@config.logger.debug('EventsManager: Firing SDK_READY event for new subscription') if @config.debug_enabled
|
|
24
24
|
fire_sdk_event(sdk_event, nil)
|
|
25
25
|
return
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
@config.logger.debug("EventsManager: Register event: #{sdk_event}") if @config.debug_enabled
|
|
29
|
-
@active_subscriptions[sdk_event] = Engine::Models::EventActiveSubscriptions.new(false, event_handler)
|
|
29
|
+
@active_subscriptions[sdk_event] = SplitIoClient::Engine::Models::EventActiveSubscriptions.new(false, event_handler)
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -66,7 +66,7 @@ module SplitIoClient
|
|
|
66
66
|
private
|
|
67
67
|
|
|
68
68
|
def check_if_register_needed(sorted_event)
|
|
69
|
-
sorted_event == Engine::Models::SdkEvent::SDK_READY &&
|
|
69
|
+
sorted_event == SplitIoClient::Engine::Models::SdkEvent::SDK_READY &&
|
|
70
70
|
get_event_handler(sorted_event).nil? &&
|
|
71
71
|
!@active_subscriptions.include?(sorted_event)
|
|
72
72
|
end
|
|
@@ -110,7 +110,7 @@ module SplitIoClient
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def get_sdk_event_if_applicable(sdk_internal_event)
|
|
113
|
-
final_sdk_event = Engine::Models::ValidSdkEvent.new(nil, false)
|
|
113
|
+
final_sdk_event = SplitIoClient::Engine::Models::ValidSdkEvent.new(nil, false)
|
|
114
114
|
|
|
115
115
|
events_to_fire = []
|
|
116
116
|
require_any_sdk_event = check_require_any(sdk_internal_event)
|
|
@@ -118,7 +118,7 @@ module SplitIoClient
|
|
|
118
118
|
if (!event_already_triggered(require_any_sdk_event.sdk_event) &&
|
|
119
119
|
execution_limit(require_any_sdk_event.sdk_event) == 1) ||
|
|
120
120
|
execution_limit(require_any_sdk_event.sdk_event) == -1
|
|
121
|
-
final_sdk_event = Engine::Models::ValidSdkEvent.new(
|
|
121
|
+
final_sdk_event = SplitIoClient::Engine::Models::ValidSdkEvent.new(
|
|
122
122
|
require_any_sdk_event.sdk_event,
|
|
123
123
|
check_prerequisites(require_any_sdk_event.sdk_event) &&
|
|
124
124
|
check_suppressed_by(require_any_sdk_event.sdk_event)
|
|
@@ -178,10 +178,10 @@ module SplitIoClient
|
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
def check_require_any(sdk_internal_event)
|
|
181
|
-
valid_sdk_event = Engine::Models::ValidSdkEvent.new(nil, false)
|
|
181
|
+
valid_sdk_event = SplitIoClient::Engine::Models::ValidSdkEvent.new(nil, false)
|
|
182
182
|
@manager_config.require_any.each do |name, val|
|
|
183
183
|
if val.include?(sdk_internal_event)
|
|
184
|
-
valid_sdk_event = Engine::Models::ValidSdkEvent.new(name, true)
|
|
184
|
+
valid_sdk_event = SplitIoClient::Engine::Models::ValidSdkEvent.new(name, true)
|
|
185
185
|
return valid_sdk_event
|
|
186
186
|
end
|
|
187
187
|
end
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: false
|
|
2
2
|
|
|
3
3
|
module SplitIoClient
|
|
4
|
-
module Engine
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
attr_reader :internal_event, :metadata
|
|
4
|
+
module Engine::Models
|
|
5
|
+
class SdkInternalEventNotification
|
|
6
|
+
attr_reader :internal_event, :metadata
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
end
|
|
8
|
+
def initialize(internal_event, metadata)
|
|
9
|
+
@internal_event = internal_event
|
|
10
|
+
@metadata = metadata
|
|
13
11
|
end
|
|
14
12
|
end
|
|
15
13
|
end
|
|
@@ -169,16 +169,12 @@ module SplitIoClient
|
|
|
169
169
|
when Constants::PUSH_SUBSYSTEM_OFF
|
|
170
170
|
process_push_shutdown
|
|
171
171
|
else
|
|
172
|
-
|
|
172
|
+
@config.logger.debug('Incorrect push status type.') if @config.debug_enabled
|
|
173
173
|
end
|
|
174
174
|
end
|
|
175
175
|
rescue StandardError => e
|
|
176
176
|
@config.logger.error("Push status handler error: #{e.inspect}")
|
|
177
177
|
end
|
|
178
178
|
end
|
|
179
|
-
|
|
180
|
-
def log_if_debug(msg)
|
|
181
|
-
@config.logger.debug(msg) if @config.debug_enabled
|
|
182
|
-
end
|
|
183
179
|
end
|
|
184
180
|
end
|
|
@@ -52,9 +52,7 @@ module SplitIoClient
|
|
|
52
52
|
|
|
53
53
|
def perform
|
|
54
54
|
while (notification = @queue.pop)
|
|
55
|
-
if @config.debug_enabled
|
|
56
|
-
@config.logger.debug("feature_flags_worker change_number dequeue #{notification.data['changeNumber']}")
|
|
57
|
-
end
|
|
55
|
+
@config.logger.debug("feature_flags_worker change_number dequeue #{notification.data['changeNumber']}") if @config.debug_enabled
|
|
58
56
|
case notification.data['type']
|
|
59
57
|
when SSE::EventSource::EventTypes::SPLIT_UPDATE
|
|
60
58
|
success = update_feature_flag(notification)
|
|
@@ -119,9 +117,7 @@ module SplitIoClient
|
|
|
119
117
|
def kill_feature_flag(notification)
|
|
120
118
|
return if @feature_flags_repository.get_change_number.to_i > notification.data['changeNumber']
|
|
121
119
|
|
|
122
|
-
if @config.debug_enabled
|
|
123
|
-
@config.logger.debug("feature_flags_worker kill #{notification.data['splitName']}, #{notification.data['changeNumber']}")
|
|
124
|
-
end
|
|
120
|
+
@config.logger.debug("feature_flags_worker kill #{notification.data['splitName']}, #{notification.data['changeNumber']}") if @config.debug_enabled
|
|
125
121
|
@feature_flags_repository.kill(notification.data['changeNumber'],
|
|
126
122
|
notification.data['splitName'],
|
|
127
123
|
notification.data['defaultTreatment'])
|