pubnub 4.1.5 → 4.1.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pubnub might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 242c68a87d13a592b515cb79a777a446dd116c1c695572ff380f6cf4dad7cfa3
4
- data.tar.gz: bced3ce328f2d1f5c19c99c07046d55805a9d2518b812c42a77b629e6094eb61
3
+ metadata.gz: 04517d5210c2213931c074c40ecbeeb804179cf8ce28c4f21350321e560b5560
4
+ data.tar.gz: 8a8b59f386f3d62e747707762856d517e936f0983a3ee393a39e7b97d515bd5b
5
5
  SHA512:
6
- metadata.gz: c99236e15a94867504dd45f3992d1cc5fb7dacd8bba2a81ec69c8cb5cec15b6a62c14a0116e439ce25a840f624299fdde1a41ab999547493fd12bfb9312d284a
7
- data.tar.gz: 71d4d5f51af2032fa75a93e0541bc4dc3e17cf60309c54ec49f852d7dd61166988888e68948e06b2aef5500902dfd260d05bbbd2219d25d6845c5c83cb8b9842
6
+ metadata.gz: f294ccd614f20cc7d2ec694ecc9cf493d65c2460833638ec316d793b628e225d7d36c2827491ce4ca77eaf24d1f2daab6e2ede0bcd082123f9bc0aadbf8a266f
7
+ data.tar.gz: ffb4e0e6977f9efc895abf1fb20e4235fca9fe78a0ed8d8a3d52e2eac9f4bfe8d4d79f5161994df95592996a8925bb2a9c2d48ec0806f5467eee44eac3c1c0a0
@@ -1,6 +1,11 @@
1
1
  ---
2
- version: "4.1.5"
2
+ version: "4.1.6"
3
3
  changelog:
4
+ - changes:
5
+ - text: "Added signal feature"
6
+ type: feature
7
+ date: 21-8-2019
8
+ version: "4.1.6"
4
9
  -
5
10
  changes:
6
11
  -
@@ -295,6 +300,8 @@ features:
295
300
  - SUBSCRIBE-WITH-TIMETOKEN
296
301
  - SUBSCRIBE-WILDCARD
297
302
  - SUBSCRIBE-FILTER-EXPRESSION
303
+ signal:
304
+ - SIGNAL-SEND
298
305
  time:
299
306
  - TIME-TIME
300
307
  name: ruby
@@ -303,15 +310,13 @@ scm: github.com/pubnub/ruby
303
310
  supported-platforms:
304
311
  -
305
312
  editors:
306
- - "ruby 2.4.0"
307
- - "ruby 2.3.3"
308
- - "ruby 2.2.6"
309
- - "ruby 2.1.10"
310
- - jruby-9.1.8.0
313
+ - "ruby 2.6"
314
+ - "ruby 2.5"
315
+ - "ruby 2.4"
311
316
  platforms:
312
- - "FreeBSD 8-STABLE or later, amd64, 386."
313
- - "Linux 2.6 or later, amd64, 386."
314
- - "Mac OS X 10.8 or later, amd64"
315
- - "Windows 7 or later, amd64, 386, use rubyinstaller and dev pack."
316
- - "Apart from the above, PubNub Ruby SDK works on mostly all platforms where the supported Ruby versions work. To use ssl connection, Ruby should be compiled with openssl support."
317
+ - "FreeBSD 8-STABLE or later, amd64, 386"
318
+ - "Linux 2.6 or later, amd64, 386"
319
+ - "macOS 10.8 or later, amd64"
320
+ - "Windows 7 or later, amd64, 386, use rubyinstaller and dev pack"
321
+ - "Apart from the above, the PubNub Ruby SDK works on almost every platform where the supported Ruby versions work. To use an SSL connection, Ruby should be compiled with OpenSSL support."
317
322
  version: "PubNub Ruby SDK"
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.4
2
3
  Exclude:
3
4
  - 'spec/**/*'
4
5
  - 'examples/**/*'
@@ -24,4 +25,3 @@ Metrics/PerceivedComplexity:
24
25
  Metrics/CyclomaticComplexity:
25
26
  Enabled: false
26
27
 
27
- TargetRubyVersion: 2.4
@@ -23,5 +23,5 @@ matrix:
23
23
  include:
24
24
  - rvm: jruby-head
25
25
  env: JRUBY_OPTS="--server -J-Xms1500m -J-Xmx1500m -J-XX:+UseConcMarkSweepGC -J-XX:-UseGCOverheadLimit -J-XX:+CMSClassUnloadingEnabled"
26
- jdk: oraclejdk8
26
+ jdk: oraclejdk9
27
27
 
@@ -1,3 +1,6 @@
1
+ ##### 4.1.6
2
+ * Added signal feature
3
+
1
4
  ##### 4.1.5
2
5
  * Update dependency dry-validation
3
6
  * Includes minimum Ruby version requirement of 2.4+
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pubnub (4.1.5)
4
+ pubnub (4.1.6)
5
5
  concurrent-ruby (~> 1.1.5)
6
6
  concurrent-ruby-edge (~> 0.5.0)
7
7
  dry-validation (~> 1.0)
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  # Complete Documentation
8
8
  Available at https://www.pubnub.com/docs/ruby/pubnub-ruby-sdk-v4 **v4.x**
9
9
 
10
- ## PubNub Gem version 4.1.5
10
+ ## PubNub Gem version 4.1.6
11
11
 
12
12
  ##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API.
13
13
  ##### http://www.pubnub.com/account
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.5
1
+ 4.1.6
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://ps.pndsn.com/signal/demo/demo/0/demo/0/%2200000000000000000000000000000000000000000000000000%22?auth=ruby-test-auth&ortt=%7B%22t%22:15663104632819572%7D&pnsdk=PubNub-Ruby/4.1.5&seqn=1&uuid=ruby-test-uuid
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.4.6 (2019-04-01))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Tue, 20 Aug 2019 14:14:23 GMT
16
+ response:
17
+ status:
18
+ code: 400
19
+ message: INVALID
20
+ headers:
21
+ Date:
22
+ - Tue, 20 Aug 2019 14:14:25 GMT
23
+ Content-Type:
24
+ - text/javascript; charset="UTF-8"
25
+ Content-Length:
26
+ - '47'
27
+ Connection:
28
+ - keep-alive
29
+ Cache-Control:
30
+ - no-cache
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Allow-Methods:
34
+ - GET
35
+ body:
36
+ encoding: UTF-8
37
+ string: '[0,"Signal size too large","15663104658224536"]'
38
+ http_version:
39
+ recorded_at: Tue, 20 Aug 2019 14:14:23 GMT
40
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://ps.pndsn.com/signal/demo/demo/0/demo/0/%22whatever%22?auth=ruby-test-auth&ortt=%7B%22t%22:15663104631310930%7D&pnsdk=PubNub-Ruby/4.1.5&seqn=1&uuid=ruby-test-uuid
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.4.6 (2019-04-01))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Tue, 20 Aug 2019 14:14:23 GMT
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Tue, 20 Aug 2019 14:14:25 GMT
23
+ Content-Type:
24
+ - text/javascript; charset="UTF-8"
25
+ Content-Length:
26
+ - '30'
27
+ Connection:
28
+ - keep-alive
29
+ Cache-Control:
30
+ - no-cache
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Allow-Methods:
34
+ - GET
35
+ body:
36
+ encoding: UTF-8
37
+ string: '[1,"Sent","15663104657143915"]'
38
+ http_version:
39
+ recorded_at: Tue, 20 Aug 2019 14:14:23 GMT
40
+ recorded_with: VCR 5.0.0
@@ -49,6 +49,7 @@ require 'pubnub/validators/where_now'
49
49
  require 'pubnub/validators/delete'
50
50
  require 'pubnub/validators/message_counts'
51
51
  require 'pubnub/validators/push'
52
+ require 'pubnub/validators/signal'
52
53
 
53
54
  Dir[File.join(File.dirname(__dir__), 'pubnub', 'events', '*.rb')].each do |file|
54
55
  require file
@@ -5,7 +5,7 @@ module Pubnub
5
5
  # Module that holds generator for all events
6
6
  module Events
7
7
  EVENTS = %w[publish subscribe presence leave history here_now audit grant delete_messages
8
- revoke time heartbeat where_now set_state state channel_registration message_counts
8
+ revoke time heartbeat where_now set_state state channel_registration message_counts signal
9
9
  add_channels_to_push list_push_provisions remove_channels_from_push remove_device_from_push].freeze
10
10
 
11
11
  EVENTS.each do |event_name|
@@ -65,6 +65,7 @@ module Pubnub
65
65
  OPERATION_LIST_PUSH_PROVISIONS = :list_push_provisions
66
66
  OPERATION_REMOVE_CHANNELS_FROM_PUSH = :remove_channels_from_push
67
67
  OPERATION_REMOVE_DEVICE_FROM_PUSH = :remove_device_from_push
68
+ OPERATION_SIGNAL = :signal
68
69
 
69
70
  OPERATIONS = [
70
71
  OPERATION_SUBSCRIBE, OPERATION_HEARTBEAT, OPERATION_PRESENCE, OPERATION_TIME, OPERATION_HISTORY,
@@ -72,7 +73,7 @@ module Pubnub
72
73
  OPERATION_LIST_ALL_CHANNELS_IN_CHANNEL_GROUP, OPERATION_CHANNEL_GROUP_ADD, OPERATION_CHANNEL_GROUP_REMOVE,
73
74
  OPERATION_AUDIT, OPERATION_GRANT, OPERATION_REVOKE, OPERATION_WHERE_NOW, OPERATION_MESSAGE_COUNTS,
74
75
  OPERATION_ADD_CHANNELS_TO_PUSH, OPERATION_LIST_PUSH_PROVISIONS, OPERATION_REMOVE_CHANNELS_FROM_PUSH,
75
- OPERATION_REMOVE_DEVICE_FROM_PUSH
76
+ OPERATION_REMOVE_DEVICE_FROM_PUSH, OPERATION_SIGNAL
76
77
  ].freeze
77
78
 
78
79
  # Announcements
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Toplevel Pubnub module.
4
+ module Pubnub
5
+ # Holds history functionality
6
+ class Signal < SingleEvent
7
+ include Concurrent::Async
8
+ include Pubnub::Validator::Signal
9
+
10
+ attr_reader :store
11
+
12
+ def initialize(options, app)
13
+ @event = :signal
14
+ @telemetry_name = :l_sig
15
+ super
16
+ @sequence_number = sequence_number!
17
+ @origination_time_token = @app.generate_ortt
18
+ end
19
+
20
+ private
21
+
22
+ def current_operation
23
+ Pubnub::Constants::OPERATION_SIGNAL
24
+ end
25
+
26
+ def parameters(*_args)
27
+ params = super
28
+
29
+ params = params.merge(seqn: @sequence_number,
30
+ ortt: { t: @origination_time_token })
31
+ params
32
+ end
33
+
34
+ def path
35
+ '/' + [
36
+ 'signal',
37
+ @publish_key,
38
+ @subscribe_key,
39
+ '0',
40
+ Formatter.format_channel(@channel, true),
41
+ '0',
42
+ Formatter.format_message(@message, @cipher_key)
43
+ ].join('/')
44
+ end
45
+
46
+ def sequence_number!
47
+ @app.sequence_number_for_publish!
48
+ end
49
+
50
+ def timetoken(parsed_response)
51
+ parsed_response[2]
52
+ rescue StandardError
53
+ nil
54
+ end
55
+
56
+ def response_message(parsed_response)
57
+ parsed_response[1]
58
+ rescue StandardError
59
+ nil
60
+ end
61
+
62
+ def valid_envelope(parsed_response, req_res_objects)
63
+ Pubnub::Envelope.new(
64
+ event: @event,
65
+ event_options: @given_options,
66
+ timetoken: timetoken(parsed_response),
67
+ status: {
68
+ code: req_res_objects[:response].code,
69
+ operation: Pubnub::Constants::OPERATION_SIGNAL,
70
+ client_request: req_res_objects[:request],
71
+ server_response: req_res_objects[:response],
72
+ data: nil,
73
+ category: Pubnub::Constants::STATUS_ACK,
74
+ error: false,
75
+ auto_retried: false,
76
+
77
+ current_timetoken: nil,
78
+ last_timetoken: nil,
79
+ subscribed_channels: nil,
80
+ subscribed_channel_groups: nil,
81
+
82
+ config: get_config
83
+ }
84
+ )
85
+ end
86
+ end
87
+ end
@@ -8,7 +8,8 @@ module Pubnub
8
8
  @callbacks = {
9
9
  message: options[:message],
10
10
  status: options[:status],
11
- presence: options[:presence]
11
+ presence: options[:presence],
12
+ signal: options[:signal]
12
13
  }
13
14
  validate!
14
15
  end
@@ -164,6 +164,8 @@ module Pubnub
164
164
  Pubnub::Constants::OPERATION_TIME
165
165
  elsif message[:channel].to_s.index(/pnpres\z/)
166
166
  Pubnub::Constants::OPERATION_PRESENCE
167
+ elsif message[:type] == 1
168
+ Pubnub::Constants::OPERATION_SIGNAL
167
169
  else
168
170
  Pubnub::Constants::OPERATION_SUBSCRIBE
169
171
  end
@@ -193,6 +195,7 @@ module Pubnub
193
195
  channel: m['c'],
194
196
  subscription_match: m['b'],
195
197
  payload: m['d'],
198
+ type: m['e'],
196
199
  flags: m['f'],
197
200
  issuing_client_id: m['i'],
198
201
  subscribe_key: m['k'],
@@ -71,6 +71,8 @@ module Pubnub
71
71
  case envelope.result[:operation]
72
72
  when Pubnub::Constants::OPERATION_SUBSCRIBE
73
73
  secure_call callbacks.callbacks[:message], envelope
74
+ when Pubnub::Constants::OPERATION_SIGNAL
75
+ secure_call callbacks.callbacks[:signal], envelope
74
76
  when Pubnub::Constants::OPERATION_PRESENCE
75
77
  secure_call callbacks.callbacks[:presence], envelope
76
78
  else
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Toplevel Pubnub module.
4
+ module Pubnub
5
+ # Validator module that holds all validators modules
6
+ module Validator
7
+ # Validator for Signal event
8
+ module Signal
9
+ include CommonValidator
10
+
11
+ def validate!
12
+ return if @skip_validate
13
+
14
+ validate_publish_key!
15
+ validate_channel!
16
+ validate_message!
17
+ end
18
+
19
+ private
20
+
21
+ def validate_publish_key!
22
+ return unless @publish_key.nil?
23
+
24
+ raise(
25
+ ArgumentError.new,
26
+ ':publish_key is required for publish event.'
27
+ )
28
+ end
29
+
30
+ def validate_channel!
31
+ return unless @channel.nil? || @channel.empty?
32
+
33
+ raise(
34
+ ArgumentError.new,
35
+ ':channel is required for publish event.'
36
+ )
37
+ end
38
+
39
+ def validate_message!
40
+ return unless @message.nil?
41
+
42
+ raise(
43
+ ArgumentError.new,
44
+ ':message is required for publish event.'
45
+ )
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,4 +1,4 @@
1
1
  # Toplevel Pubnub module.
2
2
  module Pubnub
3
- VERSION = '4.1.5'.freeze
3
+ VERSION = '4.1.6'.freeze
4
4
  end
@@ -29,7 +29,7 @@ describe Pubnub::Presence do
29
29
  end
30
30
 
31
31
  expect(envelopes[0].status[:code]).to eq(200)
32
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403696, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036961172863", :region_code => 1}})
32
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403696, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036961172863", :region_code => 1}})
33
33
  expect(envelopes[0].status[:category]).to eq(:ack)
34
34
  expect(envelopes[0].status[:auto_retried]).to eq(true)
35
35
  expect(envelopes[0].status[:current_timetoken]).to eq(14654036961931472)
@@ -54,7 +54,7 @@ describe Pubnub::Presence do
54
54
  end
55
55
 
56
56
  expect(envelopes[0].status[:code]).to eq(200)
57
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "leave", "timestamp" => 1465403696, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036965065315", :region_code => 2}})
57
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "leave", "timestamp" => 1465403696, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036965065315", :region_code => 2}})
58
58
  expect(envelopes[0].status[:category]).to eq(:ack)
59
59
  expect(envelopes[0].status[:auto_retried]).to eq(true)
60
60
  expect(envelopes[0].status[:current_timetoken]).to eq(14654036965469160)
@@ -79,7 +79,7 @@ describe Pubnub::Presence do
79
79
  end
80
80
 
81
81
  expect(envelopes[0].status[:code]).to eq(200)
82
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403698, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036986516448", :region_code => 2}})
82
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403698, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036986516448", :region_code => 2}})
83
83
  expect(envelopes[0].status[:category]).to eq(:ack)
84
84
  expect(envelopes[0].status[:auto_retried]).to eq(true)
85
85
  expect(envelopes[0].status[:current_timetoken]).to eq(14654036986900265)
@@ -203,7 +203,7 @@ describe Pubnub::Presence do
203
203
  end
204
204
 
205
205
  expect(envelopes[0].status[:code]).to eq(200)
206
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403699, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036996668692", :region_code => 1}})
206
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403699, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654036996668692", :region_code => 1}})
207
207
  expect(envelopes[0].status[:category]).to eq(:ack)
208
208
  expect(envelopes[0].status[:auto_retried]).to eq(true)
209
209
  expect(envelopes[0].status[:current_timetoken]).to eq(14654036997432530)
@@ -228,7 +228,7 @@ describe Pubnub::Presence do
228
228
  end
229
229
 
230
230
  expect(envelopes[0].status[:code]).to eq(200)
231
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => nil, :payload => {"action" => "leave", "timestamp" => 1465403700, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654037002398263", :region_code => 1}})
231
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => nil, :payload => {"action" => "leave", "timestamp" => 1465403700, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654037002398263", :region_code => 1}})
232
232
  expect(envelopes[0].status[:category]).to eq(:ack)
233
233
  expect(envelopes[0].status[:auto_retried]).to eq(true)
234
234
  expect(envelopes[0].status[:current_timetoken]).to eq(14654037003110327)
@@ -253,7 +253,7 @@ describe Pubnub::Presence do
253
253
  end
254
254
 
255
255
  expect(envelopes[0].status[:code]).to eq(200)
256
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403702, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654037023404890", :region_code => 1}})
256
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403702, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654037023404890", :region_code => 1}})
257
257
  expect(envelopes[0].status[:category]).to eq(:ack)
258
258
  expect(envelopes[0].status[:auto_retried]).to eq(true)
259
259
  expect(envelopes[0].status[:current_timetoken]).to eq(14654037024165554)
@@ -377,7 +377,7 @@ describe Pubnub::Presence do
377
377
  end
378
378
 
379
379
  expect(envelopes[0].status[:code]).to eq(200)
380
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "leave", "timestamp" => 1465403703, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654037039766378", :region_code => 2}})
380
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "leave", "timestamp" => 1465403703, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654037039766378", :region_code => 2}})
381
381
  expect(envelopes[0].status[:category]).to eq(:ack)
382
382
  expect(envelopes[0].status[:auto_retried]).to eq(true)
383
383
  expect(envelopes[0].status[:current_timetoken]).to eq(14654037040157428)
@@ -402,7 +402,7 @@ describe Pubnub::Presence do
402
402
  end
403
403
 
404
404
  expect(envelopes[0].status[:code]).to eq(200)
405
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465405069, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654050693824272", :region_code => 1}})
405
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465405069, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654050693824272", :region_code => 1}})
406
406
  expect(envelopes[0].status[:category]).to eq(:ack)
407
407
  expect(envelopes[0].status[:auto_retried]).to eq(true)
408
408
  expect(envelopes[0].status[:current_timetoken]).to eq(14654050694555754)
@@ -427,7 +427,7 @@ describe Pubnub::Presence do
427
427
  end
428
428
 
429
429
  expect(envelopes[0].status[:code]).to eq(200)
430
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403890, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038904558577", :region_code => 2}})
430
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => nil, :payload => {"action" => "join", "timestamp" => 1465403890, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038904558577", :region_code => 2}})
431
431
  expect(envelopes[0].status[:category]).to eq(:ack)
432
432
  expect(envelopes[0].status[:auto_retried]).to eq(true)
433
433
  expect(envelopes[0].status[:current_timetoken]).to eq(14654038904954461)
@@ -551,7 +551,7 @@ describe Pubnub::Presence do
551
551
  end
552
552
 
553
553
  expect(envelopes[0].status[:code]).to eq(200)
554
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => "demo-pnpres", :payload => {"action" => "leave", "timestamp" => 1465403891, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038913084722", :region_code => 1}})
554
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => "demo-pnpres", :payload => {"action" => "leave", "timestamp" => 1465403891, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038913084722", :region_code => 1}})
555
555
  expect(envelopes[0].status[:category]).to eq(:ack)
556
556
  expect(envelopes[0].status[:auto_retried]).to eq(true)
557
557
  expect(envelopes[0].status[:current_timetoken]).to eq(14654038913920232)
@@ -576,7 +576,7 @@ describe Pubnub::Presence do
576
576
  end
577
577
 
578
578
  expect(envelopes[0].status[:code]).to eq(200)
579
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => "demo.*-pnpres", :payload => {"action" => "leave", "timestamp" => 1465403892, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038929920942", :region_code => 1}})
579
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo.*-pnpres", :subscription_match => "demo.*-pnpres", :payload => {"action" => "leave", "timestamp" => 1465403892, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 0}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038929920942", :region_code => 1}})
580
580
  expect(envelopes[0].status[:category]).to eq(:ack)
581
581
  expect(envelopes[0].status[:auto_retried]).to eq(true)
582
582
  expect(envelopes[0].status[:current_timetoken]).to eq(14654038931856126)
@@ -601,7 +601,7 @@ describe Pubnub::Presence do
601
601
  end
602
602
 
603
603
  expect(envelopes[0].status[:code]).to eq(200)
604
- expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => "demo-pnpres", :payload => {"action" => "join", "timestamp" => 1465403893, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038934962157", :region_code => 2}})
604
+ expect(envelopes[0].status[:data]).to eq({:shard => "5", :channel => "demo-pnpres", :subscription_match => "demo-pnpres", :payload => {"action" => "join", "timestamp" => 1465403893, "uuid" => "ruby-test-uuid-client-two", "occupancy" => 1}, :flags => 0, :issuing_client_id => nil, :subscribe_key => "sub-a-mock-key", :sequence_number => nil, :user_meta_data => nil, :replication_map => nil, :eat_after_reading => nil, :type => nil, :waypoint_list => nil, :origination_time_token => nil, :publish_timetoken => {:timetoken => "14654038934962157", :region_code => 2}})
605
605
  expect(envelopes[0].status[:category]).to eq(:ack)
606
606
  expect(envelopes[0].status[:auto_retried]).to eq(true)
607
607
  expect(envelopes[0].status[:current_timetoken]).to eq(14654038935342617)