pubnub 6.0.0 → 6.0.2

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: c36bc86a2f133f6f5974503383e8a341f517bbf7891b42ff0cdbf72bc476cf78
4
- data.tar.gz: 11419a00c1d4e4a7fbe4490c02c620b6f53c9eb4ce271fd9066906179ad11703
3
+ metadata.gz: daa6325913f4e4fa3b9a42a89dcb268ec8b9174ca7c30d1b26e0b94bb4e8d3c3
4
+ data.tar.gz: e8cdc5e228388108d80cc51daa58e7a0a08d71aa69f51ae206fbcfe020aa7433
5
5
  SHA512:
6
- metadata.gz: 4a14e16bb803de51bcf238ec6da333089361e7488840fe404c855ddf9773bfdd644f27e50b6bce1f0e797f0de2b0622e65a13ff39eb26b849918f4dd4c7629a0
7
- data.tar.gz: fc9f7a8ddeb94dd53734b5fb7a8cbfc2158c0ce1a43db29d8e91dd19d08ef3ab32a39e1dd3177c1963ed531f80253c73bcc15539b5de91c76868d54c98a966a6
6
+ metadata.gz: 3a2c68e75729803cd99a560b82b4974929a8e10d8b8c2845c4146655055c9505ea606b58427eb631860fdded94a8df7b16f36b35617ac59e2c5dbb50ed8d46da
7
+ data.tar.gz: 8cb3e679e395a59214da0a21233ae080097a4600a6351644a59021e80dff85f9fb86e22a6b784d7c00092ed3944d80d7cbb89276842becc0df998a7e15d8bbf3
data/.bundle/config CHANGED
@@ -1,2 +1,2 @@
1
1
  ---
2
- BUNDLE_WITHOUT: "development"
2
+ BUNDLE_WITHOUT: "'development'"
data/.github/CODEOWNERS CHANGED
@@ -1,2 +1,2 @@
1
- * @parfeon @jguz-pubnub
2
- README.md @techwritermat @kazydek @parfeon @jguz-pubnub
1
+ * @parfeon @mohitpubnub @jguz-pubnub
2
+ README.md @techwritermat @kazydek @parfeon @mohitpubnub @jguz-pubnub
data/.pubnub.yml CHANGED
@@ -1,6 +1,22 @@
1
1
  ---
2
- version: "6.0.0"
2
+ version: "6.0.2"
3
3
  changelog:
4
+ - date: 2026-03-03
5
+ version: v6.0.2
6
+ changes:
7
+ - type: improvement
8
+ text: "Add `.uniq` calls when building subscribe URL path and channel-group query parameter to prevent duplicate channels and channel groups from leaking into HTTP requests."
9
+ - type: improvement
10
+ text: "Add `.uniq` calls when building heartbeat URL path and channel-group query parameter to prevent duplicate channels and channel groups from leaking into HTTP requests."
11
+ - date: 2025-11-04
12
+ version: v6.0.1
13
+ changes:
14
+ - type: bug
15
+ text: "Send proper object for `state` with the `heartbeat` request."
16
+ - type: improvement
17
+ text: "Don't cap `limit` and let the server perform value validation."
18
+ - type: improvement
19
+ text: "Replace legacy timetoken query parameter with subscribe v2 parameters."
4
20
  - date: 2025-10-15
5
21
  version: v6.0.0
6
22
  changes:
@@ -618,7 +634,7 @@ sdks:
618
634
  - x86-64
619
635
  - distribution-type: package
620
636
  distribution-repository: RubyGems
621
- package-name: pubnub-6.0.0.gem
637
+ package-name: pubnub-6.0.2.gem
622
638
  location: https://rubygems.org/gems/pubnub
623
639
  requires:
624
640
  - name: addressable
@@ -723,8 +739,8 @@ sdks:
723
739
  - x86-64
724
740
  - distribution-type: library
725
741
  distribution-repository: GitHub release
726
- package-name: pubnub-6.0.0.gem
727
- location: https://github.com/pubnub/ruby/releases/download/v6.0.0/pubnub-6.0.0.gem
742
+ package-name: pubnub-6.0.2.gem
743
+ location: https://github.com/pubnub/ruby/releases/download/v6.0.2/pubnub-6.0.2.gem
728
744
  requires:
729
745
  - name: addressable
730
746
  min-version: 2.0.0
data/CHANGELOG.md CHANGED
@@ -1,28 +1,45 @@
1
- ## v6.0.0
2
- October 15 2025
3
-
4
- #### Added
5
- - BREAKING CHANGES: Add 'limit' and 'offset' parameters for 'here_now' for pagination support.
6
-
7
- ## v5.6.0
8
- September 11 2025
9
-
10
- #### Added
11
- - Add the `encode_channels` parameter for `fetch` to enable or disable channel names percent-encoding in response.
12
-
13
- ## v5.5.1
14
- September 08 2025
15
-
16
- #### Fixed
17
- - Fix the issue introduced by RuboCop linter suggestion acceptance, which caused a wrong number of arguments error.
18
-
19
- ## v5.5.0
20
- January 28 2025
21
-
22
- #### Added
23
- - Add the ability to specify `type` and `status` fields for `channel metadata`, `uuid metadata`, `member`, and `membership`.
24
- - Add missing `include` options for App Context APIs: `custom`, `status`, `type`, `uuid_status`, `uuid_type`, `channel_status`, and `channel_type`.
25
-
1
+ ## v6.0.2
2
+ March 03 2026
3
+
4
+ #### Modified
5
+ - Add `.uniq` calls when building subscribe URL path and channel-group query parameter to prevent duplicate channels and channel groups from leaking into HTTP requests.
6
+ - Add `.uniq` calls when building heartbeat URL path and channel-group query parameter to prevent duplicate channels and channel groups from leaking into HTTP requests.
7
+
8
+ ## v6.0.1
9
+ November 04 2025
10
+
11
+ #### Fixed
12
+ - Send proper object for `state` with the `heartbeat` request.
13
+
14
+ #### Modified
15
+ - Don't cap `limit` and let the server perform value validation.
16
+ - Replace legacy timetoken query parameter with subscribe v2 parameters.
17
+
18
+ ## v6.0.0
19
+ October 15 2025
20
+
21
+ #### Added
22
+ - BREAKING CHANGES: Add 'limit' and 'offset' parameters for 'here_now' for pagination support.
23
+
24
+ ## v5.6.0
25
+ September 11 2025
26
+
27
+ #### Added
28
+ - Add the `encode_channels` parameter for `fetch` to enable or disable channel names percent-encoding in response.
29
+
30
+ ## v5.5.1
31
+ September 08 2025
32
+
33
+ #### Fixed
34
+ - Fix the issue introduced by RuboCop linter suggestion acceptance, which caused a wrong number of arguments error.
35
+
36
+ ## v5.5.0
37
+ January 28 2025
38
+
39
+ #### Added
40
+ - Add the ability to specify `type` and `status` fields for `channel metadata`, `uuid metadata`, `member`, and `membership`.
41
+ - Add missing `include` options for App Context APIs: `custom`, `status`, `type`, `uuid_status`, `uuid_type`, `channel_status`, and `channel_type`.
42
+
26
43
  ## v5.4.0
27
44
  January 07 2025
28
45
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pubnub (6.0.0)
4
+ pubnub (6.0.2)
5
5
  addressable (>= 2.0.0)
6
6
  concurrent-ruby (~> 1.3.4)
7
7
  concurrent-ruby-edge (~> 0.7.1)
@@ -113,7 +113,7 @@ Most important part: `result[:data]`
113
113
  {:code=>200,
114
114
  :operation=>:subscribe,
115
115
  :client_request=>
116
- #<URI::HTTP http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
116
+ #<URI::HTTP http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&tr=12&tt=14793085739462384&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
117
117
  :server_response=>
118
118
  #<HTTP::Message:0x0056126377b368
119
119
  @http_body=
@@ -147,7 +147,7 @@ Most important part: `result[:data]`
147
147
  @request_method="GET",
148
148
  @request_query=nil,
149
149
  @request_uri=
150
- #<Addressable::URI:0x2b0931bbdf54 URI:http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
150
+ #<Addressable::URI:0x2b0931bbdf54 URI:http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&tr=12&tt=14793085739462384&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
151
151
  @status_code=200>,
152
152
  @peer_cert=nil,
153
153
  @previous=nil>,
@@ -162,7 +162,7 @@ Most important part: `result[:data]`
162
162
  @status=
163
163
  {:code=>200,
164
164
  :client_request=>
165
- #<URI::HTTP http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
165
+ #<URI::HTTP http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&tr=12&tt=14793085739462384&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
166
166
  :server_response=>
167
167
  #<HTTP::Message:0x0056126377b368
168
168
  @http_body=
@@ -196,7 +196,7 @@ Most important part: `result[:data]`
196
196
  @request_method="GET",
197
197
  @request_query=nil,
198
198
  @request_uri=
199
- #<Addressable::URI:0x2b0931bbdf54 URI:http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
199
+ #<Addressable::URI:0x2b0931bbdf54 URI:http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&tr=12&tt=14793085739462384&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
200
200
  @status_code=200>,
201
201
  @peer_cert=nil,
202
202
  @previous=nil>,
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.0
1
+ 6.0.2
data/lib/pubnub/client.rb CHANGED
@@ -310,11 +310,11 @@ module Pubnub
310
310
  return unless event.state
311
311
 
312
312
  event.channel.each do |channel|
313
- @env[:state][event.origin][:channel][channel] = event.state
313
+ @env[:state][event.origin][channel] = event.state
314
314
  end
315
315
 
316
316
  event.group.each do |group|
317
- @env[:state][event.origin][:group][group] = event.state
317
+ @env[:state][event.origin][group] = event.state
318
318
  end
319
319
  end
320
320
 
@@ -357,8 +357,6 @@ module Pubnub
357
357
  def create_state_pools(event)
358
358
  @env[:state] ||= {}
359
359
  @env[:state][event.origin] ||= {}
360
- @env[:state][event.origin][:channel] ||= {}
361
- @env[:state][event.origin][:group] ||= {}
362
360
  end
363
361
 
364
362
  def setup_httpclient(event_type)
@@ -25,16 +25,19 @@ module Pubnub
25
25
  'sub-key',
26
26
  @subscribe_key,
27
27
  'channel',
28
- Formatter.channels_for_url(@channel),
28
+ Formatter.channels_for_url(@channel.uniq),
29
29
  'heartbeat'
30
30
  ].join('/')
31
31
  end
32
32
 
33
33
  def parameters(*_args)
34
34
  parameters = super
35
- parameters[:state] = encode_state(@app.env[:state][@origin]) if @app.env[:state] && @app.env[:state][@origin]
35
+ if @app.env[:state] && @app.env[:state][@origin]
36
+ parameters[:state] = encode_state(@app.env[:state][@origin])
37
+ parameters.delete(:state) if parameters[:state] == '%7B%7D'
38
+ end
36
39
  parameters[:heartbeat] = @heartbeat
37
- parameters['channel-group'] = @group.join(',') unless @group.blank?
40
+ parameters['channel-group'] = @group.uniq.join(',') unless @group.blank?
38
41
  parameters
39
42
  end
40
43
 
@@ -52,11 +52,7 @@ module Pubnub
52
52
  parameters['channel-group'] = @group.join(',') unless @group.blank?
53
53
 
54
54
  if current_operation == Pubnub::Constants::OPERATION_HERE_NOW
55
- @limit = if !@limit&.positive?
56
- Pubnub::Constants::MAXIMUM_HERE_NOW_COUNT
57
- else
58
- [Pubnub::Constants::MAXIMUM_HERE_NOW_COUNT, @limit].min
59
- end
55
+ @limit = Pubnub::Constants::MAXIMUM_HERE_NOW_COUNT if @limit.nil?
60
56
  @offset = 0 if @offset.nil?
61
57
 
62
58
  parameters['limit'] = @limit
@@ -124,7 +124,7 @@ module Pubnub
124
124
  'v2',
125
125
  'subscribe',
126
126
  @subscribe_key,
127
- Pubnub::Formatter.channels_for_url(@channel + @wildcard_channel),
127
+ Pubnub::Formatter.channels_for_url((@channel + @wildcard_channel).uniq),
128
128
  0
129
129
  ].join('/').gsub(/\?/, '%3F')
130
130
  end
@@ -143,17 +143,20 @@ module Pubnub
143
143
  end
144
144
 
145
145
  def add_timetoken_to_params(params)
146
- params[:t] = encode_parameter(r: @app.region_code, t: @app.timetoken)
146
+ if @app.env[:timetoken]&.to_i&.positive?
147
+ params[:tt] = @app.timetoken
148
+ params[:tr] = @app.region_code
149
+ end
147
150
  params
148
151
  end
149
152
 
150
153
  def add_group_to_params(params)
151
- params['channel-group'] = @group.join(',') unless @group.empty?
154
+ params['channel-group'] = @group.uniq.join(',') unless @group.empty?
152
155
  params
153
156
  end
154
157
 
155
158
  def add_state_to_params(params)
156
- params[:state] = encode_parameter(@app.env[:state][@origin][:channel].merge(@app.env[:state][@origin][:group])) unless @app.empty_state?
159
+ params[:state] = encode_parameter(@app.env[:state][@origin]) unless @app.empty_state?
157
160
  params
158
161
  end
159
162
  end
@@ -1,4 +1,4 @@
1
1
  # Toplevel Pubnub module.
2
2
  module Pubnub
3
- VERSION = '6.0.0'.freeze
3
+ VERSION = '6.0.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubnub
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - PubNub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-15 00:00:00.000000000 Z
11
+ date: 2026-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable