Closed
Description
openedon May 3, 2022
Issue Description
Introduced here #1621 in versions 4.8.1 and above.
I believe the intention here is that when additional context is given for the same key, and when the value is a Hash, we want to append any new key values to the existing Hash as shown in the description.
The problem is that not all values are Hashes, which results in 👇
NoMethodError: undefined method `merge' for "bar":String
Reproduction Steps
Sentry.configure_scope do |scope|
scope.set_contexts({:foo => "bar"})
end
Sentry.configure_scope do |scope|
scope.set_contexts({:foo => "new bar"})
end
Expected Behavior
Replaces the existing "bar" value with "new bar"
Actual Behavior
NoMethodError: undefined method `merge' for "new bar":String
from /srv/bundle/ruby/2.7.0/gems/sentry-ruby-core-4.8.1/lib/sentry/scope.rb:132:in `block in set_contexts'
### Ruby Version
2.7.5
### SDK Version
5.3.0
Activity