bugsnag 6.11.0 → 6.11.1
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/VERSION +1 -1
- data/lib/bugsnag/breadcrumbs/validator.rb +4 -4
- data/lib/bugsnag/integrations/rails/rails_breadcrumbs.rb +1 -4
- data/spec/breadcrumbs/validator_spec.rb +12 -12
- data/spec/session_tracker_spec.rb +5 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fc49d1de25e741d85e743661a97ed65c14b4c147f6d2ddb5ce80be233aae244
|
4
|
+
data.tar.gz: b67ad9235232b3eb001475a07cc1698ee44b2c48c6c59acfffda4b88a20ad4c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f87742900794a8a7bfc442d80b57366360d00b57e4c1e55667b62d9ee669610b2c35ebd94edacd86526b0b88137df99838f5db3ee54ad8efccd2cfbec1cb1f14
|
7
|
+
data.tar.gz: 6520b4f661659dacd4ce54acf4a0c75a3815dbe7f667343e377639a5d90d39f3b0e9cc7ab054032a22be50e5c846ad64719c9fb23882840e521dc88602887e9e
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
## 6.11.1 (22 Jan 2019)
|
5
|
+
|
6
|
+
### Fixes
|
7
|
+
|
8
|
+
* Fix issue with unnecessary meta_data being logged during breadcrumb validation.
|
9
|
+
| [#530](https://github.com/bugsnag/bugsnag-ruby/pull/530)
|
10
|
+
|
4
11
|
## 6.11.0 (17 Jan 2019)
|
5
12
|
|
6
13
|
**Note**: this release alters the behaviour of the notifier to track sessions automatically.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.11.
|
1
|
+
6.11.1
|
@@ -17,7 +17,7 @@ module Bugsnag::Breadcrumbs
|
|
17
17
|
def validate(breadcrumb)
|
18
18
|
# Check name length
|
19
19
|
if breadcrumb.name.size > Bugsnag::Breadcrumbs::MAX_NAME_LENGTH
|
20
|
-
@configuration.
|
20
|
+
@configuration.debug("Breadcrumb name trimmed to length #{Bugsnag::Breadcrumbs::MAX_NAME_LENGTH}. Original name: #{breadcrumb.name}")
|
21
21
|
breadcrumb.name = breadcrumb.name.slice(0...Bugsnag::Breadcrumbs::MAX_NAME_LENGTH)
|
22
22
|
end
|
23
23
|
|
@@ -26,21 +26,21 @@ module Bugsnag::Breadcrumbs
|
|
26
26
|
if valid_meta_data_type?(v)
|
27
27
|
true
|
28
28
|
else
|
29
|
-
@configuration.
|
29
|
+
@configuration.debug("Breadcrumb #{breadcrumb.name} meta_data #{k}:#{v.class} has been dropped for having an invalid data type")
|
30
30
|
false
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
# Check type is valid, set to manual otherwise
|
35
35
|
unless Bugsnag::Breadcrumbs::VALID_BREADCRUMB_TYPES.include?(breadcrumb.type)
|
36
|
-
@configuration.
|
36
|
+
@configuration.debug("Invalid type: #{breadcrumb.type} for breadcrumb: #{breadcrumb.name}, defaulting to #{Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE}")
|
37
37
|
breadcrumb.type = Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE
|
38
38
|
end
|
39
39
|
|
40
40
|
# If auto is true, check type is in enabled_automatic_breadcrumb_types
|
41
41
|
return unless breadcrumb.auto && !@configuration.enabled_automatic_breadcrumb_types.include?(breadcrumb.type)
|
42
42
|
|
43
|
-
@configuration.
|
43
|
+
@configuration.debug("Automatic breadcrumb of type #{breadcrumb.type} ignored: #{breadcrumb.name}")
|
44
44
|
breadcrumb.ignore!
|
45
45
|
end
|
46
46
|
|
@@ -22,7 +22,6 @@ module Bugsnag::Rails
|
|
22
22
|
:message => "Read cache",
|
23
23
|
:type => Bugsnag::Breadcrumbs::PROCESS_BREADCRUMB_TYPE,
|
24
24
|
:allowed_data => [
|
25
|
-
:key,
|
26
25
|
:hit,
|
27
26
|
:super_operation
|
28
27
|
]
|
@@ -31,9 +30,7 @@ module Bugsnag::Rails
|
|
31
30
|
:id => "cache_fetch_hit.active_support",
|
32
31
|
:message => "Fetch cache hit",
|
33
32
|
:type => Bugsnag::Breadcrumbs::PROCESS_BREADCRUMB_TYPE,
|
34
|
-
:allowed_data => [
|
35
|
-
:key
|
36
|
-
]
|
33
|
+
:allowed_data => []
|
37
34
|
},
|
38
35
|
{
|
39
36
|
:id => "sql.active_record",
|
@@ -26,7 +26,7 @@ RSpec.describe Bugsnag::Breadcrumbs::Validator do
|
|
26
26
|
})
|
27
27
|
|
28
28
|
expect(breadcrumb).to_not receive(:ignore!)
|
29
|
-
expect(config).to_not receive(:
|
29
|
+
expect(config).to_not receive(:debug)
|
30
30
|
|
31
31
|
validator.validate(breadcrumb)
|
32
32
|
end
|
@@ -49,7 +49,7 @@ RSpec.describe Bugsnag::Breadcrumbs::Validator do
|
|
49
49
|
expect(breadcrumb).to_not receive(:ignore!)
|
50
50
|
expect(breadcrumb).to receive(:name=).with("123456789012345678901234567890")
|
51
51
|
expected_string = "Breadcrumb name trimmed to length 30. Original name: #{name}"
|
52
|
-
expect(config).to receive(:
|
52
|
+
expect(config).to receive(:debug).with(expected_string)
|
53
53
|
|
54
54
|
validator.validate(breadcrumb)
|
55
55
|
# Check the original message has not been modified
|
@@ -80,7 +80,7 @@ RSpec.describe Bugsnag::Breadcrumbs::Validator do
|
|
80
80
|
})
|
81
81
|
|
82
82
|
expect(breadcrumb).to_not receive(:ignore!)
|
83
|
-
expect(config).to_not receive(:
|
83
|
+
expect(config).to_not receive(:debug)
|
84
84
|
|
85
85
|
validator.validate(breadcrumb)
|
86
86
|
end
|
@@ -110,12 +110,12 @@ RSpec.describe Bugsnag::Breadcrumbs::Validator do
|
|
110
110
|
})
|
111
111
|
|
112
112
|
expect(breadcrumb).to_not receive(:ignore!)
|
113
|
-
expected_string_1 = "Breadcrumb #{breadcrumb.name} meta_data array
|
114
|
-
expected_string_2 = "Breadcrumb #{breadcrumb.name} meta_data hash
|
115
|
-
expected_string_3 = "Breadcrumb #{breadcrumb.name} meta_data object
|
116
|
-
expect(config).to receive(:
|
117
|
-
expect(config).to receive(:
|
118
|
-
expect(config).to receive(:
|
113
|
+
expected_string_1 = "Breadcrumb #{breadcrumb.name} meta_data array:Array has been dropped for having an invalid data type"
|
114
|
+
expected_string_2 = "Breadcrumb #{breadcrumb.name} meta_data hash:Hash has been dropped for having an invalid data type"
|
115
|
+
expected_string_3 = "Breadcrumb #{breadcrumb.name} meta_data object:TestClass has been dropped for having an invalid data type"
|
116
|
+
expect(config).to receive(:debug).with(expected_string_1)
|
117
|
+
expect(config).to receive(:debug).with(expected_string_2)
|
118
|
+
expect(config).to receive(:debug).with(expected_string_3)
|
119
119
|
|
120
120
|
# Confirms that the meta_data is being filtered
|
121
121
|
expect(breadcrumb).to receive(:meta_data=).with({
|
@@ -144,7 +144,7 @@ RSpec.describe Bugsnag::Breadcrumbs::Validator do
|
|
144
144
|
expect(breadcrumb).to receive(:type=).with(Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE)
|
145
145
|
expect(breadcrumb).to_not receive(:ignore!)
|
146
146
|
expected_string = "Invalid type: #{type} for breadcrumb: #{breadcrumb.name}, defaulting to #{Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE}"
|
147
|
-
expect(config).to receive(:
|
147
|
+
expect(config).to receive(:debug).with(expected_string)
|
148
148
|
|
149
149
|
validator.validate(breadcrumb)
|
150
150
|
end
|
@@ -169,7 +169,7 @@ RSpec.describe Bugsnag::Breadcrumbs::Validator do
|
|
169
169
|
|
170
170
|
expect(breadcrumb).to receive(:ignore!)
|
171
171
|
expected_string = "Automatic breadcrumb of type #{Bugsnag::Breadcrumbs::ERROR_BREADCRUMB_TYPE} ignored: #{breadcrumb.name}"
|
172
|
-
expect(config).to receive(:
|
172
|
+
expect(config).to receive(:debug).with(expected_string)
|
173
173
|
|
174
174
|
validator.validate(breadcrumb)
|
175
175
|
end
|
@@ -191,7 +191,7 @@ RSpec.describe Bugsnag::Breadcrumbs::Validator do
|
|
191
191
|
})
|
192
192
|
|
193
193
|
expect(breadcrumb).to_not receive(:ignore!)
|
194
|
-
expect(config).to_not receive(:
|
194
|
+
expect(config).to_not receive(:debug)
|
195
195
|
|
196
196
|
validator.validate(breadcrumb)
|
197
197
|
end
|
@@ -2,14 +2,6 @@
|
|
2
2
|
require 'webrick'
|
3
3
|
require 'spec_helper'
|
4
4
|
require 'json'
|
5
|
-
require 'concurrent'
|
6
|
-
|
7
|
-
# Enable reset of session_counts between each example
|
8
|
-
module Bugsnag
|
9
|
-
class SessionTracker
|
10
|
-
attr_accessor :session_counts
|
11
|
-
end
|
12
|
-
end
|
13
5
|
|
14
6
|
describe Bugsnag::SessionTracker do
|
15
7
|
server = nil
|
@@ -27,7 +19,7 @@ describe Bugsnag::SessionTracker do
|
|
27
19
|
Thread.new{ server.start }
|
28
20
|
end
|
29
21
|
|
30
|
-
|
22
|
+
before(:each) do
|
31
23
|
Bugsnag.instance_variable_set(:@session_tracker, Bugsnag::SessionTracker.new)
|
32
24
|
end
|
33
25
|
|
@@ -40,6 +32,10 @@ describe Bugsnag::SessionTracker do
|
|
40
32
|
queue.clear
|
41
33
|
end
|
42
34
|
|
35
|
+
after(:all) do
|
36
|
+
Bugsnag.instance_variable_set(:@session_tracker, Bugsnag::SessionTracker.new)
|
37
|
+
end
|
38
|
+
|
43
39
|
it 'adds session object to queue' do
|
44
40
|
tracker = Bugsnag::SessionTracker.new
|
45
41
|
tracker.start_session
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.11.
|
4
|
+
version: 6.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|