From 2def1fc90f47d0e2aa08b985ac84f411937ac2d2 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 10:12:00 +0000 Subject: [PATCH 1/2] chore(ruby): Remove unused Configuration#error_messages Its last caller was removed in #1601 when the transport stopped checking sending_allowed?. The method is @api private and nothing in the monorepo calls it. --- sentry-ruby/lib/sentry/configuration.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sentry-ruby/lib/sentry/configuration.rb b/sentry-ruby/lib/sentry/configuration.rb index 05894a670..4034818af 100644 --- a/sentry-ruby/lib/sentry/configuration.rb +++ b/sentry-ruby/lib/sentry/configuration.rb @@ -856,12 +856,6 @@ def detect_release log_error("Error detecting release", e, debug: debug) end - # @api private - def error_messages - @errors = [@errors[0]] + @errors[1..-1].map(&:downcase) # fix case of all but first - @errors.join(", ") - end - # @api private def run_after_close_callbacks run_callbacks(:after, :closed) From f251d3fd861302dfb2d26a32008aba90fc295280 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 10:17:28 +0000 Subject: [PATCH 2/2] chore(ruby): Remove unused Configuration#errors tracking With error_messages gone, nothing reads @errors outside of specs. Drop the private errors reader and the helpers that only existed to populate it, which also stops sending_to_dsn_allowed? from mutating state on every call. Co-Authored-By: Neel Shah <6536764+sl0thentr0py@users.noreply.github.com> --- sentry-ruby/lib/sentry/configuration.rb | 22 ++----------------- sentry-ruby/spec/sentry/configuration_spec.rb | 3 --- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/sentry-ruby/lib/sentry/configuration.rb b/sentry-ruby/lib/sentry/configuration.rb index 4034818af..b640676ac 100644 --- a/sentry-ruby/lib/sentry/configuration.rb +++ b/sentry-ruby/lib/sentry/configuration.rb @@ -421,7 +421,7 @@ def include_local_variables=(value) # these are not config options # @!visibility private - attr_reader :errors, :gem_specs + attr_reader :gem_specs # These exceptions could enter Puma's `lowlevel_error_handler` callback and the SDK's Puma integration # But they are mostly considered as noise and should be ignored by default @@ -764,9 +764,7 @@ def sending_allowed? end def sending_to_dsn_allowed? - @errors = [] - - valid? && capture_in_environment? + !!@dsn&.valid? && enabled_in_current_env? end def sample_allowed? @@ -902,22 +900,6 @@ def safe_const_get(x) nil end - def capture_in_environment? - return true if enabled_in_current_env? - - @errors << "Not configured to send/capture in environment '#{environment}'" - false - end - - def valid? - if @dsn&.valid? - true - else - @errors << "DSN not set or not valid" - false - end - end - def environment_from_env ENV["SENTRY_CURRENT_ENV"] || ENV["SENTRY_ENVIRONMENT"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" end diff --git a/sentry-ruby/spec/sentry/configuration_spec.rb b/sentry-ruby/spec/sentry/configuration_spec.rb index efd1024fb..8743bcded 100644 --- a/sentry-ruby/spec/sentry/configuration_spec.rb +++ b/sentry-ruby/spec/sentry/configuration_spec.rb @@ -476,13 +476,11 @@ it 'should send events if test is whitelisted' do subject.enabled_environments = %w[test] expect(subject.sending_allowed?).to eq(true) - expect(subject.errors).to be_empty end it 'should not send events if test is not whitelisted' do subject.enabled_environments = %w[not_test] expect(subject.sending_allowed?).to eq(false) - expect(subject.errors).to eq(["Not configured to send/capture in environment 'test'"]) end end @@ -551,7 +549,6 @@ it 'captured_allowed returns false' do expect(subject.sending_allowed?).to eq(false) - expect(subject.errors).to eq(["DSN not set or not valid"]) end end