From 1a4f04d3d7aeb9112b7ba73373dc0b4345c674c2 Mon Sep 17 00:00:00 2001 From: seph Date: Tue, 20 Aug 2019 10:58:19 -0400 Subject: [PATCH 1/2] Allow symbols in breadcrumbs Validate Symbol as an allowed type to breadcrumbs. I can't tell if this will have break something else, I can't trace everywhere it's used. Fixes https://github.com/bugsnag/bugsnag-ruby/issues/539 --- lib/bugsnag/breadcrumbs/validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bugsnag/breadcrumbs/validator.rb b/lib/bugsnag/breadcrumbs/validator.rb index 64eabb434..85509fe21 100644 --- a/lib/bugsnag/breadcrumbs/validator.rb +++ b/lib/bugsnag/breadcrumbs/validator.rb @@ -53,7 +53,7 @@ def validate(breadcrumb) # # @param value [Object] the object to be type checked def valid_meta_data_type?(value) - value.nil? || value.is_a?(String) || value.is_a?(Numeric) || value.is_a?(FalseClass) || value.is_a?(TrueClass) + value.nil? || value.is_a?(String) || value.is_a?(Symbol) || value.is_a?(Numeric) || value.is_a?(FalseClass) || value.is_a?(TrueClass) end end end From c1fde6c7f085c6d027feff5b5f0bb6ec3b5b5ef3 Mon Sep 17 00:00:00 2001 From: Tom Longridge Date: Tue, 27 Aug 2019 09:43:58 +0100 Subject: [PATCH 2/2] test/docs: updated spec and added changelog --- CHANGELOG.md | 3 +++ lib/bugsnag/breadcrumbs/validator.rb | 2 +- spec/breadcrumbs/validator_spec.rb | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f18527090..e82a050be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ Changelog | [#545](https://github.com/bugsnag/bugsnag-ruby/issues/545) | [#548](https://github.com/bugsnag/bugsnag-ruby/pull/548) +* Allow symbols in breadcrumb meta data. + | [#563](https://github.com/bugsnag/bugsnag-ruby/pull/563) + ## 6.11.1 (22 Jan 2019) ### Fixes diff --git a/lib/bugsnag/breadcrumbs/validator.rb b/lib/bugsnag/breadcrumbs/validator.rb index 85509fe21..c6893b50a 100644 --- a/lib/bugsnag/breadcrumbs/validator.rb +++ b/lib/bugsnag/breadcrumbs/validator.rb @@ -49,7 +49,7 @@ def validate(breadcrumb) ## # Tests whether the meta_data types are non-complex objects. # - # Acceptable types are String, Numeric, TrueClass, FalseClass, and nil. + # Acceptable types are String, Symbol, Numeric, TrueClass, FalseClass, and nil. # # @param value [Object] the object to be type checked def valid_meta_data_type?(value) diff --git a/spec/breadcrumbs/validator_spec.rb b/spec/breadcrumbs/validator_spec.rb index 34de2c20d..07e7b2c5b 100644 --- a/spec/breadcrumbs/validator_spec.rb +++ b/spec/breadcrumbs/validator_spec.rb @@ -64,6 +64,7 @@ meta_data = { :string => "This is a string", + :symbol => :this_is_a_symbol, :integer => 12345, :float => 12345.6789, :false => false,