Skip to content

Regression in 4.8.2: ActiveJobs return nil even if they have a return value #1666

@davidwessman

Description

@davidwessman

Issue Description

When upgrading from 4.8.1 for sentry-{ruby, rails, sidekiq} to 4.8.2 all ActiveJob calls return nil.

I am not 100% sure why we have return values from these jobs and they are only used in tests.

Reproduction Steps

class SentryJob < ActiveJob::Base
  def perform
    "hello"
  end
end
require "test_helper"

class SentryJobTest < ActiveSupport::TestCase
  test "#perform" do
    value = SentryJob.perform_now
    assert_equal("hello", value)
  end
end

Expected Behavior

Should return the value from perform

Actual Behavior

Returns nil

Ruby Version

2.6.9

SDK Version

4.8.2

Integration and Its Version

  • sentry-rails 4.8.2
  • sentry-sidekiq 4.8.2
  • Rails 5.2.6

Sentry Config

SENTRY_FILTER = %i[password more_params]

Sentry.init do |config|
  config.environment = "appname"
  config.breadcrumbs_logger = [:active_support_logger, :http_logger]
  config.traces_sample_rate = 0.1
  config.propagate_traces = false

  filter = if Rails::VERSION::MAJOR >= 6
    # Rails 6
    ActiveSupport::ParameterFilter.new(
      SENTRY_FILTER
    )
  else
    # Rails 5
    ActionDispatch::Http::ParameterFilter.new(
      SENTRY_FILTER
    )
  end

  config.before_send = lambda do |event, hint|
    filter.filter(event.to_hash)
  end
end

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions