Skip to content

Commit cdbba26

Browse files
authored
Merge pull request #513 from splitio/development
[8.3.1] Development into master
2 parents 71ca2eb + 7d46b9c commit cdbba26

File tree

7 files changed

+31
-6
lines changed

7 files changed

+31
-6
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
CHANGES
2+
3+
8.3.1 (Mar 22, 2024)
4+
- Fixed ruby process hanging due to failed thread.join command, when calling destroy and a http request still active.
5+
- Fixed streaming notification parser. Issue ref: https://github.com/splitio/ruby-client/issues/511
6+
27
8.3.0 (Dec 11, 2023)
38
- Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation):
49
- Added new variations of the get treatment methods to support evaluating flags in given flag set/s.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2023 Split Software, Inc.
1+
Copyright © 2024 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

lib/splitclient-rb/exceptions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module SplitIoClient
22
class SplitIoError < StandardError; end
33

4-
class SDKShutdownException < SplitIoError; end
4+
class SDKShutdownException < Exception; end
55

66
class SDKBlockerTimeoutExpiredException < SplitIoError; end
77

lib/splitclient-rb/sse/event_source/event_parser.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def first_event(raw_data)
4343
private
4444

4545
def parse_event_data(data, type)
46-
event_data = JSON.parse(data.sub('data: ', ''))
46+
data_value = data.sub('data:', '')
47+
event_data = JSON.parse(data_value.strip)
4748
client_id = event_data['clientId']&.strip
4849
channel = event_data['channel']&.strip
4950
parsed_data = JSON.parse(event_data['data']) unless type == 'error'

lib/splitclient-rb/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SplitIoClient
2-
VERSION = '8.3.0'
2+
VERSION = '8.3.1'
33
end

spec/integrations/push_client_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,16 @@
168168

169169
client = factory.client
170170
client.block_until_ready
171-
sleep(2)
172-
expect(client.get_treatment('admin', 'bilal_split')).to eq('off')
171+
172+
treatment = 'control'
173+
for i in 1..5 do
174+
p i
175+
sleep(1)
176+
treatment = client.get_treatment('admin', 'bilal_split')
177+
break if treatment != 'control'
178+
end
179+
180+
expect(treatment).to eq('off')
173181
end
174182
end
175183

spec/sse/event_source/event_parser_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
let(:log) { StringIO.new }
88
let(:config) { SplitIoClient::SplitConfig.new(logger: Logger.new(log)) }
99

10+
let(:event_split_update_ws) { "fb\r\nid:123\nevent:message\ndata:{\"id\":\"1\",\"clientId\":\"emptyClientId\",\"connectionId\":\"1\",\"timestamp\":1582045421733,\"channel\":\"channel-test\",\"data\":\"{\\\"type\\\" : \\\"SPLIT_UPDATE\\\",\\\"changeNumber\\\": 5564531221}\",\"name\":\"asdasd\"}\n\n\r\n" }
1011
let(:event_split_update) { "fb\r\nid: 123\nevent: message\ndata: {\"id\":\"1\",\"clientId\":\"emptyClientId\",\"connectionId\":\"1\",\"timestamp\":1582045421733,\"channel\":\"channel-test\",\"data\":\"{\\\"type\\\" : \\\"SPLIT_UPDATE\\\",\\\"changeNumber\\\": 5564531221}\",\"name\":\"asdasd\"}\n\n\r\n" }
1112
let(:event_split_kill) { "fb\r\nid: 123\nevent: message\ndata: {\"id\":\"1\",\"clientId\":\"emptyClientId\",\"connectionId\":\"1\",\"timestamp\":1582045421733,\"channel\":\"channel-test\",\"data\":\"{\\\"type\\\" : \\\"SPLIT_KILL\\\",\\\"changeNumber\\\": 5564531221, \\\"defaultTreatment\\\" : \\\"off\\\", \\\"splitName\\\" : \\\"split-test\\\"}\",\"name\":\"asdasd\"}\n\n\r\n" }
1213
let(:event_segment_update) { "fb\r\nid: 123\nevent: message\ndata: {\"id\":\"1\",\"clientId\":\"emptyClientId\",\"connectionId\":\"1\",\"timestamp\":1582045421733,\"channel\":\"channel-test\",\"data\":\"{\\\"type\\\" : \\\"SEGMENT_UPDATE\\\",\\\"changeNumber\\\": 5564531221, \\\"segmentName\\\" : \\\"segment-test\\\"}\",\"name\":\"asdasd\"}\n\n\r\n" }
@@ -25,6 +26,16 @@
2526
expect(event.channel).to eq('channel-test')
2627
end
2728

29+
it 'split update event - fixing event parser' do
30+
parser = subject.new(config)
31+
32+
event = parser.parse(event_split_update_ws)[0]
33+
expect(event.event_type).to eq('message')
34+
expect(event.data['type']).to eq('SPLIT_UPDATE')
35+
expect(event.data['changeNumber']).to eq(5_564_531_221)
36+
expect(event.channel).to eq('channel-test')
37+
end
38+
2839
it 'split kill event' do
2940
parser = subject.new(config)
3041

0 commit comments

Comments
 (0)