Skip to content

Commit ebab5d9

Browse files
committed
Fix regression with CheckInEvent in before_send
1 parent b5a4948 commit ebab5d9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

sentry-ruby/lib/sentry/client.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def send_event(event, hint = nil)
184184
event = configuration.before_send.call(event, hint)
185185

186186
case event
187-
when ErrorEvent
187+
when ErrorEvent, CheckInEvent
188188
# do nothing
189189
when Hash
190190
log_debug(<<~MSG)

sentry-ruby/spec/sentry/client/event_sending_spec.rb

+12
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,18 @@
240240
end
241241
end
242242

243+
context "for check in events" do
244+
let(:event_object) { client.event_from_check_in("test_slug", :ok) }
245+
246+
it "does not fail due to before_send" do
247+
configuration.before_send = lambda { |e, _h| e }
248+
client.send_event(event)
249+
250+
expect(client.transport).to receive(:send_event).with(event)
251+
client.send_event(event)
252+
end
253+
end
254+
243255
it "doesn't apply before_send_transaction to Event" do
244256
dbl = double("before_send_transaction")
245257
allow(dbl).to receive(:call)

0 commit comments

Comments
 (0)