bugsnag 6.18.0 → 6.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/VERSION +1 -1
- data/lib/bugsnag/breadcrumbs/validator.rb +0 -22
- data/lib/bugsnag/helpers.rb +15 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3825d21f3c5d15bfb0244584a4cf18032fae0c7432a829db961b8310f3c679
|
4
|
+
data.tar.gz: 0b6008183c0562e67c8a5ef1ae6c599645aad55313fbcc3aa6d7a7b2996ca98d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffc195c3a00ecbf51f76974ac5281536ff406fa944030b6c36f907cdabceaa79a15720094c4f7f53347cbc760819cb0600cbd5ed9117d8e3d1d34e3f614e9eb3
|
7
|
+
data.tar.gz: ca216fbbf877e60007be16315bad08ce1d5b07a884e4dc83ef2c7e548cd4511b31e92f608cfe5ee7463adf0bad6e33710009a4679bab45089481ffa918fd44ec
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
## 6.19.0 (6 January 2021)
|
5
|
+
|
6
|
+
### Enhancements
|
7
|
+
|
8
|
+
* Exception messages will be truncated if they have a length greater than 3,072
|
9
|
+
| [#636](https://github.com/bugsnag/bugsnag-ruby/pull/636)
|
10
|
+
| [joshuapinter](https://github.com/joshuapinter)
|
11
|
+
|
12
|
+
* Breadcrumb metadata can now contain any type
|
13
|
+
| [#648](https://github.com/bugsnag/bugsnag-ruby/pull/648)
|
14
|
+
|
4
15
|
## 6.18.0 (27 October 2020)
|
5
16
|
|
6
17
|
### Enhancements
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.19.0
|
@@ -15,16 +15,6 @@ module Bugsnag::Breadcrumbs
|
|
15
15
|
#
|
16
16
|
# @param breadcrumb [Bugsnag::Breadcrumbs::Breadcrumb] the breadcrumb to be validated
|
17
17
|
def validate(breadcrumb)
|
18
|
-
# Check meta_data hash doesn't contain complex values
|
19
|
-
breadcrumb.meta_data = breadcrumb.meta_data.select do |k, v|
|
20
|
-
if valid_meta_data_type?(v)
|
21
|
-
true
|
22
|
-
else
|
23
|
-
@configuration.debug("Breadcrumb #{breadcrumb.name} meta_data #{k}:#{v.class} has been dropped for having an invalid data type")
|
24
|
-
false
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
18
|
# Check type is valid, set to manual otherwise
|
29
19
|
unless Bugsnag::Breadcrumbs::VALID_BREADCRUMB_TYPES.include?(breadcrumb.type)
|
30
20
|
@configuration.debug("Invalid type: #{breadcrumb.type} for breadcrumb: #{breadcrumb.name}, defaulting to #{Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE}")
|
@@ -37,17 +27,5 @@ module Bugsnag::Breadcrumbs
|
|
37
27
|
@configuration.debug("Automatic breadcrumb of type #{breadcrumb.type} ignored: #{breadcrumb.name}")
|
38
28
|
breadcrumb.ignore!
|
39
29
|
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
##
|
44
|
-
# Tests whether the meta_data types are non-complex objects.
|
45
|
-
#
|
46
|
-
# Acceptable types are String, Symbol, Numeric, TrueClass, FalseClass, and nil.
|
47
|
-
#
|
48
|
-
# @param value [Object] the object to be type checked
|
49
|
-
def valid_meta_data_type?(value)
|
50
|
-
value.nil? || value.is_a?(String) || value.is_a?(Symbol) || value.is_a?(Numeric) || value.is_a?(FalseClass) || value.is_a?(TrueClass)
|
51
|
-
end
|
52
30
|
end
|
53
31
|
end
|
data/lib/bugsnag/helpers.rb
CHANGED
@@ -4,7 +4,7 @@ require 'json'
|
|
4
4
|
|
5
5
|
|
6
6
|
module Bugsnag
|
7
|
-
module Helpers
|
7
|
+
module Helpers # rubocop:todo Metrics/ModuleLength
|
8
8
|
MAX_STRING_LENGTH = 3072
|
9
9
|
MAX_PAYLOAD_LENGTH = 512000
|
10
10
|
MAX_ARRAY_LENGTH = 80
|
@@ -19,8 +19,12 @@ module Bugsnag
|
|
19
19
|
|
20
20
|
return value unless payload_too_long?(value)
|
21
21
|
|
22
|
+
# Truncate exception messages
|
23
|
+
reduced_value = truncate_exception_messages(value)
|
24
|
+
return reduced_value unless payload_too_long?(reduced_value)
|
25
|
+
|
22
26
|
# Trim metadata
|
23
|
-
reduced_value = trim_metadata(
|
27
|
+
reduced_value = trim_metadata(reduced_value)
|
24
28
|
return reduced_value unless payload_too_long?(reduced_value)
|
25
29
|
|
26
30
|
# Trim code from stacktrace
|
@@ -71,6 +75,15 @@ module Bugsnag
|
|
71
75
|
|
72
76
|
TRUNCATION_INFO = '[TRUNCATED]'
|
73
77
|
|
78
|
+
##
|
79
|
+
# Truncate exception messages
|
80
|
+
def self.truncate_exception_messages(payload)
|
81
|
+
extract_exception(payload) do |exception|
|
82
|
+
exception[:message] = trim_as_string(exception[:message])
|
83
|
+
end
|
84
|
+
payload
|
85
|
+
end
|
86
|
+
|
74
87
|
##
|
75
88
|
# Remove all code from stacktraces
|
76
89
|
def self.trim_stacktrace_code(payload)
|
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.
|
4
|
+
version: 6.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
rubygems_version: 3.
|
112
|
+
rubygems_version: 3.2.0
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Ruby notifier for bugsnag.com
|