Skip to content

Commit e7812ec

Browse files
authored
Fix usage when secret_key is set (#168)
fix(fetch-message): fix usage when `secret_key`` is set Fix the issue introduced by RuboCop linter suggestion acceptance, which caused a wrong number of arguments error.
1 parent 3999cf6 commit e7812ec

File tree

9 files changed

+79
-8
lines changed

9 files changed

+79
-8
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
SDK_PAM_SEC_KEY: ${{ secrets.SDK_PAM_SEC_KEY }}
1616
SDK_SUB_KEY: ${{ secrets.SDK_SUB_KEY }}
1717
SDK_PUB_KEY: ${{ secrets.SDK_PUB_KEY }}
18+
SDK_SEC_KEY: ${{ secrets.SDK_SEC_KEY }}
1819

1920
jobs:
2021
tests:

.pubnub.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
2-
version: "5.5.0"
2+
version: "5.5.1"
33
changelog:
4+
- date: 2025-09-08
5+
version: v5.5.1
6+
changes:
7+
- type: bug
8+
text: "Fix the issue introduced by RuboCop linter suggestion acceptance, which caused a wrong number of arguments error."
49
- date: 2025-01-28
510
version: v5.5.0
611
changes:
@@ -603,7 +608,7 @@ sdks:
603608
- x86-64
604609
- distribution-type: package
605610
distribution-repository: RubyGems
606-
package-name: pubnub-5.5.0.gem
611+
package-name: pubnub-5.5.1.gem
607612
location: https://rubygems.org/gems/pubnub
608613
requires:
609614
- name: addressable
@@ -708,8 +713,8 @@ sdks:
708713
- x86-64
709714
- distribution-type: library
710715
distribution-repository: GitHub release
711-
package-name: pubnub-5.5.0.gem
712-
location: https://github.com/pubnub/ruby/releases/download/v5.5.0/pubnub-5.5.0.gem
716+
package-name: pubnub-5.5.1.gem
717+
location: https://github.com/pubnub/ruby/releases/download/v5.5.1/pubnub-5.5.1.gem
713718
requires:
714719
- name: addressable
715720
min-version: 2.0.0

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v5.5.1
2+
September 08 2025
3+
4+
#### Fixed
5+
- Fix the issue introduced by RuboCop linter suggestion acceptance, which caused a wrong number of arguments error.
6+
17
## v5.5.0
28
January 28 2025
39

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
pubnub (5.5.0)
4+
pubnub (5.5.1)
55
addressable (>= 2.0.0)
66
concurrent-ruby (~> 1.3.4)
77
concurrent-ruby-edge (~> 0.7.1)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.5.0
1+
5.5.1

fixtures/vcr_cassettes/lib/events/fetch_messages_with_secret.yml

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/pubnub/events/fetch_messages.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def current_operation
4646
@include_message_actions ? Pubnub::Constants::OPERATION_FETCH_MESSAGES_WITH_ACTIONS : Pubnub::Constants::OPERATION_FETCH_MESSAGES
4747
end
4848

49-
def parameters(signature: false)
49+
def parameters(signature = false)
5050
parameters = super(signature)
5151
parameters[:include_meta] = 'true' if @include_meta
5252
parameters[:include_uuid] = 'true' if @include_uuid

lib/pubnub/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Toplevel Pubnub module.
22
module Pubnub
3-
VERSION = '5.5.0'.freeze
3+
VERSION = '5.5.1'.freeze
44
end

spec/lib/events/fetch_messages_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@
1313
)
1414
end
1515

16+
it 'should not crash with secret key' do
17+
pubnub_sec = Pubnub::Client.new(
18+
subscribe_key: "sub-a-mock-key",
19+
publish_key: "pub-a-mock-key",
20+
secret_key: "sec-a-mock-key",
21+
auth_key: "ruby-test-auth",
22+
user_id: "ruby-test-uuid",
23+
)
24+
VCR.use_cassette("lib/events/fetch_messages_with_secret", record: :once) do
25+
expect {
26+
pubnub_sec.fetch_messages(
27+
channels: %w[channel-1 channel-2],
28+
:http_sync => true
29+
)
30+
}.to_not raise_error(ArgumentError)
31+
end
32+
end
33+
1634
it 'works with channels list' do
1735
VCR.use_cassette("lib/events/fetch_messages", record: :once) do
1836
envelope = @pubnub.fetch_messages(

0 commit comments

Comments
 (0)