Skip to content

StreamingReporter#log_error visibility changed to :public #3146

Closed

Description

@JochenLutz

Issue Description

Description

Sentry::Rails::Overrides::StreamingReporter defines log_error as a public method. The module is prepended to ActionController::Live, where the original log_error is private. A prepended module's own visibility applies, so log_error becomes a public instance method on every controller that includes ActionController::Live.

When using traceroute to check defined actions and routes, this method shows up as an action without a route.

Suggested fix

Make the override private:

module StreamingReporter
  private

  def log_error(exception)
    Sentry::Rails.capture_exception(exception)
    super
  end
end

Reproduction Steps

  1. Use Rails 8.1 with sentry-rails 7.1.0 and `traceroute.
  2. Have a controller that includes ActionController::Live. ActiveStorage's ActiveStorage::Blobs::ProxyController and ActiveStorage::Representations::ProxyController do this through ActiveStorage::Streaming.
  3. Run rails traceroute.

Expected Behavior

Adding Sentry does not change the public surface of controllers. log_error stays private, as in ActionController::Live.

Actual Behavior

Unreachable action methods (3):
  active_storage/blobs/proxy#log_error
  active_storage/representations/proxy#log_error
  frontend/proxies#log_error

Ruby Version

4.0.6

SDK Version

7.1.0

Integration and Its Version

No response

Sentry Config

No response

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions