diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index cef45b871..f0a8efbbd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,6 +15,7 @@ env: SDK_PAM_SEC_KEY: ${{ secrets.SDK_PAM_SEC_KEY }} SDK_SUB_KEY: ${{ secrets.SDK_SUB_KEY }} SDK_PUB_KEY: ${{ secrets.SDK_PUB_KEY }} + SDK_SEC_KEY: ${{ secrets.SDK_SEC_KEY }} jobs: tests: diff --git a/.pubnub.yml b/.pubnub.yml index e7b282b09..ebc761e8b 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,6 +1,11 @@ --- -version: "5.5.0" +version: "5.5.1" changelog: + - date: 2025-09-08 + version: v5.5.1 + changes: + - type: bug + text: "Fix the issue introduced by RuboCop linter suggestion acceptance, which caused a wrong number of arguments error." - date: 2025-01-28 version: v5.5.0 changes: @@ -603,7 +608,7 @@ sdks: - x86-64 - distribution-type: package distribution-repository: RubyGems - package-name: pubnub-5.5.0.gem + package-name: pubnub-5.5.1.gem location: https://rubygems.org/gems/pubnub requires: - name: addressable @@ -708,8 +713,8 @@ sdks: - x86-64 - distribution-type: library distribution-repository: GitHub release - package-name: pubnub-5.5.0.gem - location: https://github.com/pubnub/ruby/releases/download/v5.5.0/pubnub-5.5.0.gem + package-name: pubnub-5.5.1.gem + location: https://github.com/pubnub/ruby/releases/download/v5.5.1/pubnub-5.5.1.gem requires: - name: addressable min-version: 2.0.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 154271e81..f95953097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v5.5.1 +September 08 2025 + +#### Fixed +- Fix the issue introduced by RuboCop linter suggestion acceptance, which caused a wrong number of arguments error. + ## v5.5.0 January 28 2025 diff --git a/Gemfile.lock b/Gemfile.lock index 229f15223..eeb54f907 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - pubnub (5.5.0) + pubnub (5.5.1) addressable (>= 2.0.0) concurrent-ruby (~> 1.3.4) concurrent-ruby-edge (~> 0.7.1) diff --git a/VERSION b/VERSION index d50359de1..7acd1cb0e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.5.0 +5.5.1 diff --git a/fixtures/vcr_cassettes/lib/events/fetch_messages_with_secret.yml b/fixtures/vcr_cassettes/lib/events/fetch_messages_with_secret.yml new file mode 100644 index 000000000..08c06730b --- /dev/null +++ b/fixtures/vcr_cassettes/lib/events/fetch_messages_with_secret.yml @@ -0,0 +1,41 @@ +--- +http_interactions: +- request: + method: get + uri: http://ps.pndsn.com/v3/history/sub-key/sub-a-mock-key/channel/channel-1,channel-2?auth=ruby-test-auth&include_message_type=true&include_uuid=true&pnsdk=PubNub-Ruby/5.5.0&signature=v2.quFGaEboQNkHFpbv40y1tZQadAQGavFGUPUeGOyWKHE×tamp=1756998174&uuid=ruby-test-uuid + body: + encoding: UTF-8 + string: '' + headers: + User-Agent: + - HTTPClient/1.0 (2.9.0, ruby 3.2.2 (2023-03-30)) + Accept: + - "*/*" + Date: + - Thu, 04 Sep 2025 15:02:54 GMT + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 04 Sep 2025 15:02:55 GMT + Content-Type: + - text/javascript; charset="UTF-8" + Content-Length: + - '68' + Connection: + - keep-alive + Cache-Control: + - no-cache + Access-Control-Allow-Methods: + - GET, POST, DELETE, OPTIONS + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Expose-Headers: + - "*" + body: + encoding: UTF-8 + string: '{"status": 200, "error": false, "error_message": "", "channels": {}}' + recorded_at: Thu, 04 Sep 2025 15:02:54 GMT +recorded_with: VCR 6.3.1 diff --git a/lib/pubnub/events/fetch_messages.rb b/lib/pubnub/events/fetch_messages.rb index 61cd61992..0e681bf08 100644 --- a/lib/pubnub/events/fetch_messages.rb +++ b/lib/pubnub/events/fetch_messages.rb @@ -46,7 +46,7 @@ def current_operation @include_message_actions ? Pubnub::Constants::OPERATION_FETCH_MESSAGES_WITH_ACTIONS : Pubnub::Constants::OPERATION_FETCH_MESSAGES end - def parameters(signature: false) + def parameters(signature = false) parameters = super(signature) parameters[:include_meta] = 'true' if @include_meta parameters[:include_uuid] = 'true' if @include_uuid diff --git a/lib/pubnub/version.rb b/lib/pubnub/version.rb index 09002ec51..18022e8d8 100644 --- a/lib/pubnub/version.rb +++ b/lib/pubnub/version.rb @@ -1,4 +1,4 @@ # Toplevel Pubnub module. module Pubnub - VERSION = '5.5.0'.freeze + VERSION = '5.5.1'.freeze end diff --git a/spec/lib/events/fetch_messages_spec.rb b/spec/lib/events/fetch_messages_spec.rb index 406058ade..f7a7865f3 100644 --- a/spec/lib/events/fetch_messages_spec.rb +++ b/spec/lib/events/fetch_messages_spec.rb @@ -13,6 +13,24 @@ ) end + it 'should not crash with secret key' do + pubnub_sec = Pubnub::Client.new( + subscribe_key: "sub-a-mock-key", + publish_key: "pub-a-mock-key", + secret_key: "sec-a-mock-key", + auth_key: "ruby-test-auth", + user_id: "ruby-test-uuid", + ) + VCR.use_cassette("lib/events/fetch_messages_with_secret", record: :once) do + expect { + pubnub_sec.fetch_messages( + channels: %w[channel-1 channel-2], + :http_sync => true + ) + }.to_not raise_error(ArgumentError) + end + end + it 'works with channels list' do VCR.use_cassette("lib/events/fetch_messages", record: :once) do envelope = @pubnub.fetch_messages(