sentry-ruby-core 5.22.2 → 5.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cec7ea89624b935a4dce424c0fae00c871597115d1afe9b18b99c724198ca838
4
- data.tar.gz: a560347120c4a0781e7ef67d9252e90dacf37c6d32f36a3c41da01110e0cbdc9
3
+ metadata.gz: 9f58e301ed4dd9c659dee10a489bc67ec2b3965b721e88842c0749639f751c33
4
+ data.tar.gz: d7758ef8b065a2b772ccebec8eee4807683a002495ca55dab7e85f8c1b92768f
5
5
  SHA512:
6
- metadata.gz: f4cccf2539ba28964b5cf38b3b620f56f4bb7195c368a08fa6232d5ce2f9e9daf93eb1b1ca4d88b74a3e6c5b315ac2dddc253d0728af0c4316095b8a58cc5abf
7
- data.tar.gz: 7ee0819a7f3ea956a96123fb813731c440ffacbfc73e5ae37b47b650f8dded96dc4379321d1b714505c8f87a34c1b93a1ca6849a4a59697ad35f9eee5b827934
6
+ metadata.gz: 71cb5b8076d2d4015e3a078ddeb68457460578fa9466fa9d87da55863436ac17ff62e8d6ad78518fc4217950862e39302ab85db2f2835f6729b3fb47b3929a99
7
+ data.tar.gz: 5f6777c874b1544eab2e47359d61d1eb6cd725b6f1788e2595815e8340d1291e7da7632373c77635ebe717e8c75537a9157a0a904a90bdc1b518fb9819adb0e8
data/lib/sentry/client.rb CHANGED
@@ -183,7 +183,15 @@ module Sentry
183
183
  if event_type != TransactionEvent::TYPE && configuration.before_send
184
184
  event = configuration.before_send.call(event, hint)
185
185
 
186
- unless event.is_a?(ErrorEvent)
186
+ case event
187
+ when ErrorEvent
188
+ # do nothing
189
+ when Hash
190
+ log_debug(<<~MSG)
191
+ Returning a Hash from before_send is deprecated and will be removed in the next major version.
192
+ Please return a Sentry::ErrorEvent object instead.
193
+ MSG
194
+ else
187
195
  # Avoid serializing the event object in this case because we aren't sure what it is and what it contains
188
196
  log_debug(<<~MSG)
189
197
  Discarded event because before_send didn't return a Sentry::ErrorEvent object but an instance of #{event.class}
@@ -196,10 +204,17 @@ module Sentry
196
204
  if event_type == TransactionEvent::TYPE && configuration.before_send_transaction
197
205
  event = configuration.before_send_transaction.call(event, hint)
198
206
 
199
- if event.is_a?(TransactionEvent)
207
+ if event.is_a?(TransactionEvent) || event.is_a?(Hash)
200
208
  spans_after = event.is_a?(TransactionEvent) ? event.spans.size : 0
201
209
  spans_delta = spans_before - spans_after
202
210
  transport.record_lost_event(:before_send, "span", num: spans_delta) if spans_delta > 0
211
+
212
+ if event.is_a?(Hash)
213
+ log_debug(<<~MSG)
214
+ Returning a Hash from before_send_transaction is deprecated and will be removed in the next major version.
215
+ Please return a Sentry::TransactionEvent object instead.
216
+ MSG
217
+ end
203
218
  else
204
219
  # Avoid serializing the event object in this case because we aren't sure what it is and what it contains
205
220
  log_debug(<<~MSG)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sentry
4
- VERSION = "5.22.2"
4
+ VERSION = "5.22.3"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.22.2
4
+ version: 5.22.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-24 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: sentry-ruby
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 5.22.2
18
+ version: 5.22.3
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 5.22.2
25
+ version: 5.22.3
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: concurrent-ruby
28
28
  requirement: !ruby/object:Gem::Requirement