bugsnag 6.22.1 → 6.24.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a06ee3b5502be46d703f258c7bda2a5fca647fbe210095e989dd069af901a78
4
- data.tar.gz: 622e923de05d81c2d15fe65d738e7191e75b84230c0bbdcb8fed7c9f6831057c
3
+ metadata.gz: b0c0062b72786fa763b8b17ff0f72647808c2c0372c08b098b70007acc52dec9
4
+ data.tar.gz: c467bdbbe899f9e6f2ec1bf47071c8f70228f7cac51f292e8b77a6c9724da368
5
5
  SHA512:
6
- metadata.gz: 7ea25266b534f698108e3bc1cbbfeb81d6b528b77653ffe8edce45b7d6d0309faba4a43f0aeb946ace35b84b738cdd275e12cdc998abc7c2b20c02fa2ea07ed4
7
- data.tar.gz: 96a1fe53d1f2167cc3458e53ec178e6c8c25fbde85d1dca17a329da85f9ebde4e72416b5930f9ed595955c48e043e22d60915483e163d0f274a4292a06fa70d8
6
+ metadata.gz: c2cd2286a921e1cb2ad6e78e620c097a7a5937be53ebb75f020cc7eaba31505c904315083b545a1f9758ddb14c2e902c8e47e8845eef3a242fd8aec810860496
7
+ data.tar.gz: 15410f4d0280b5abb8f9804a6b66c6d05eed52c025e394ed0fbc642507d7ac64b2cb90db5a1dda0a946143d85dbab4d148dafab88697fa47bb79363d4ff6df3e
data/CHANGELOG.md CHANGED
@@ -1,6 +1,99 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## v6.24.2 (21 January 2022)
5
+
6
+ ### Fixes
7
+
8
+ * Avoid rescuing from errors in Active Record transaction callbacks in versions of Rails where they will be re-raised
9
+ | [#709](https://github.com/bugsnag/bugsnag-ruby/pull/709)
10
+ | [apalmblad](https://github.com/apalmblad)
11
+
12
+ ## v6.24.1 (30 November 2021)
13
+
14
+ ### Fixes
15
+
16
+ * Fix metadata not being recorded when using Resque outside of Active Job
17
+ | [#710](https://github.com/bugsnag/bugsnag-ruby/pull/710)
18
+ | [isnotajoke](https://github.com/isnotajoke)
19
+
20
+ ## v6.24.0 (6 October 2021)
21
+
22
+ ### Enhancements
23
+
24
+ * Allow overriding an event's unhandled flag
25
+ | [#698](https://github.com/bugsnag/bugsnag-ruby/pull/698)
26
+ * Add the ability to store metadata globally
27
+ | [#699](https://github.com/bugsnag/bugsnag-ruby/pull/699)
28
+ * Add `cookies`, `body` and `httpVersion` to the automatically captured request data for Rack apps
29
+ | [#700](https://github.com/bugsnag/bugsnag-ruby/pull/700)
30
+ * Add `Configuration#endpoints` for reading the notify and sessions endpoints and `Configuration#endpoints=` for setting them
31
+ | [#701](https://github.com/bugsnag/bugsnag-ruby/pull/701)
32
+ * Add `Configuration#redacted_keys`. This is like `meta_data_filters` but matches strings with case-insensitive equality, rather than matching based on inclusion
33
+ | [#703](https://github.com/bugsnag/bugsnag-ruby/pull/703)
34
+ * Allow pausing and resuming sessions, giving more control over the stability score
35
+ | [#704](https://github.com/bugsnag/bugsnag-ruby/pull/704)
36
+ * Add `Configuration#vendor_paths` to replace `Configuration#vendor_path`
37
+ | [#705](https://github.com/bugsnag/bugsnag-ruby/pull/705)
38
+
39
+ ### Deprecated
40
+
41
+ * In the next major release, `params` will only contain query string parameters. Currently it also contains the request body for form data requests, but this is deprecated in favour of the new `body` property
42
+ * The `Configuration#set_endpoints` method is now deprecated in favour of `Configuration#endpoints=`
43
+ * The `Configuration#meta_data_filters` option is now deprecated in favour of `Configuration#redacted_keys`
44
+ * The `Configuration#vendor_path` option is now deprecated in favour of `Configuration#vendor_paths`
45
+
46
+ ## v6.23.0 (21 September 2021)
47
+
48
+ ### Enhancements
49
+
50
+ * Sessions will now be delivered every 10 seconds, instead of every 30 seconds
51
+ | [#680](https://github.com/bugsnag/bugsnag-ruby/pull/680)
52
+ * Log errors that prevent delivery at `ERROR` level
53
+ | [#681](https://github.com/bugsnag/bugsnag-ruby/pull/681)
54
+ * Add `on_breadcrumb` callbacks to replace `before_breadcrumb_callbacks`
55
+ | [#686](https://github.com/bugsnag/bugsnag-ruby/pull/686)
56
+ * Add `context` attribute to configuration, which will be used as the default context for events. Using this option will disable automatic context setting
57
+ | [#687](https://github.com/bugsnag/bugsnag-ruby/pull/687)
58
+ | [#688](https://github.com/bugsnag/bugsnag-ruby/pull/688)
59
+ * Add `Bugsnag#breadcrumbs` getter to fetch the current list of breadcrumbs
60
+ | [#689](https://github.com/bugsnag/bugsnag-ruby/pull/689)
61
+ * Add `time` (an ISO8601 string in UTC) to `device` metadata
62
+ | [#690](https://github.com/bugsnag/bugsnag-ruby/pull/690)
63
+ * Add `errors` to `Report`/`Event` containing an array of `Error` objects. The `Error` object contains `error_class`, `error_message`, `stacktrace` and `type` (always "ruby")
64
+ | [#691](https://github.com/bugsnag/bugsnag-ruby/pull/691)
65
+ * Add `original_error` to `Report`/`Event` containing the original Exception instance
66
+ | [#692](https://github.com/bugsnag/bugsnag-ruby/pull/692)
67
+ * Add `request` to `Report`/`Event` containing HTTP request metadata
68
+ | [#693](https://github.com/bugsnag/bugsnag-ruby/pull/693)
69
+ * Add `add_metadata` and `clear_metadata` to `Report`/`Event`
70
+ | [#694](https://github.com/bugsnag/bugsnag-ruby/pull/694)
71
+ * Add `set_user` to `Report`/`Event`
72
+ | [#695](https://github.com/bugsnag/bugsnag-ruby/pull/695)
73
+
74
+ ### Fixes
75
+
76
+ * Avoid starting session delivery thread when the current release stage is not enabled
77
+ | [#677](https://github.com/bugsnag/bugsnag-ruby/pull/677)
78
+
79
+ ### Deprecated
80
+
81
+ * `before_breadcrumb_callbacks` have been deprecated in favour of `on_breadcrumb` callbacks and will be removed in the next major release
82
+ * For consistency with Bugsnag notifiers for other languages, a number of methods have been deprecated in this release. The old options will be removed in the next major version | [#676](https://github.com/bugsnag/bugsnag-ruby/pull/676)
83
+ * The `notify_release_stages` configuration option has been deprecated in favour of `enabled_release_stages`
84
+ * The `auto_capture_sessions` and `track_sessions` configuration options have been deprecated in favour of `auto_track_sessions`
85
+ * The `enabled_automatic_breadcrumb_types` configuration option has been deprecated in favour of `enabled_breadcrumb_types`
86
+ * The `Report` class has been deprecated in favour of the `Event` class
87
+ * The `Report#meta_data` attribute has been deprecated in favour of `Event#metadata`
88
+ * The `Breadcrumb#meta_data` attribute has been deprecated in favour of `Breadcrumb#metadata`
89
+ * The `Breadcrumb#name` attribute has been deprecated in favour of `Breadcrumb#message`
90
+ * The breadcrumb type constants in the `Bugsnag::Breadcrumbs` module has been deprecated in favour of the constants available in the `Bugsnag::BreadcrumbType` module
91
+ For example, `Bugsnag::Breadcrumbs::ERROR_BREADCRUMB_TYPE` is now available as `Bugsnag::BreadcrumbType::ERROR`
92
+ * `Report#exceptions` has been deprecated in favour of the new `errors` property
93
+ * `Report#raw_exceptions` has been deprecated in favour of the new `original_error` property
94
+ * Accessing request data via `Report#metadata` has been deprecated in favour of using the new `request` property. Request data will be moved out of metadata in the next major version
95
+ * The `Report#add_tab` and `Report#remove_tab` methods have been deprecated in favour of the new `add_metadata` and `clear_metadata` methods
96
+
4
97
  ## v6.22.1 (11 August 2021)
5
98
 
6
99
  ### Fixes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.22.1
1
+ 6.24.2
@@ -0,0 +1,14 @@
1
+ require "bugsnag/breadcrumbs/breadcrumbs"
2
+
3
+ module Bugsnag
4
+ module BreadcrumbType
5
+ ERROR = Bugsnag::Breadcrumbs::ERROR_BREADCRUMB_TYPE
6
+ LOG = Bugsnag::Breadcrumbs::LOG_BREADCRUMB_TYPE
7
+ MANUAL = Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE
8
+ NAVIGATION = Bugsnag::Breadcrumbs::NAVIGATION_BREADCRUMB_TYPE
9
+ PROCESS = Bugsnag::Breadcrumbs::PROCESS_BREADCRUMB_TYPE
10
+ REQUEST = Bugsnag::Breadcrumbs::REQUEST_BREADCRUMB_TYPE
11
+ STATE = Bugsnag::Breadcrumbs::STATE_BREADCRUMB_TYPE
12
+ USER = Bugsnag::Breadcrumbs::USER_BREADCRUMB_TYPE
13
+ end
14
+ end
@@ -1,11 +1,13 @@
1
1
  module Bugsnag::Breadcrumbs
2
2
  class Breadcrumb
3
+ # @deprecated Use {#message} instead
3
4
  # @return [String] the breadcrumb name
4
5
  attr_accessor :name
5
6
 
6
7
  # @return [String] the breadcrumb type
7
8
  attr_accessor :type
8
9
 
10
+ # @deprecated Use {#metadata} instead
9
11
  # @return [Hash, nil] metadata hash containing strings, numbers, or booleans, or nil
10
12
  attr_accessor :meta_data
11
13
 
@@ -23,7 +25,7 @@ module Bugsnag::Breadcrumbs
23
25
  # @api private
24
26
  #
25
27
  # @param name [String] the breadcrumb name
26
- # @param type [String] the breadcrumb type from Bugsnag::Breadcrumbs::VALID_BREADCRUMB_TYPES
28
+ # @param type [String] the breadcrumb type from Bugsnag::BreadcrumbType
27
29
  # @param meta_data [Hash, nil] a hash containing strings, numbers, or booleans, or nil
28
30
  # @param auto [Symbol] set to `:auto` if the breadcrumb is automatically generated
29
31
  def initialize(name, type, meta_data, auto)
@@ -72,5 +74,36 @@ module Bugsnag::Breadcrumbs
72
74
  :timestamp => @timestamp.iso8601(3)
73
75
  }
74
76
  end
77
+
78
+ # TODO: "message" and "metadata" can be simple attr_accessors when they
79
+ # replace "name" and "meta_data"
80
+ # NOTE: these are not aliases as YARD doesn't allow documenting the non-alias
81
+ # as deprecated without also marking the alias as deprecated
82
+
83
+ # The breadcrumb message
84
+ # @!attribute message
85
+ # @return [String]
86
+ def message
87
+ @name
88
+ end
89
+
90
+ # @param message [String]
91
+ # @return [void]
92
+ def message=(message)
93
+ @name = message
94
+ end
95
+
96
+ # A Hash containing arbitrary metadata associated with this breadcrumb
97
+ # @!attribute metadata
98
+ # @return [Hash, nil]
99
+ def metadata
100
+ @meta_data
101
+ end
102
+
103
+ # @param metadata [Hash, nil]
104
+ # @return [void]
105
+ def metadata=(metadata)
106
+ @meta_data = metadata
107
+ end
75
108
  end
76
109
  end
@@ -1,4 +1,5 @@
1
1
  module Bugsnag::Breadcrumbs
2
+ # @deprecated Use {Bugsnag::BreadcrumbType} instead
2
3
  VALID_BREADCRUMB_TYPES = [
3
4
  ERROR_BREADCRUMB_TYPE = "error",
4
5
  MANUAL_BREADCRUMB_TYPE = "manual",
@@ -0,0 +1,50 @@
1
+ require "set"
2
+
3
+ module Bugsnag::Breadcrumbs
4
+ class OnBreadcrumbCallbackList
5
+ def initialize(configuration)
6
+ @callbacks = Set.new
7
+ @mutex = Mutex.new
8
+ @configuration = configuration
9
+ end
10
+
11
+ ##
12
+ # @param callback [Proc, Method, #call]
13
+ # @return [void]
14
+ def add(callback)
15
+ @mutex.synchronize do
16
+ @callbacks.add(callback)
17
+ end
18
+ end
19
+
20
+ ##
21
+ # @param callback [Proc, Method, #call]
22
+ # @return [void]
23
+ def remove(callback)
24
+ @mutex.synchronize do
25
+ @callbacks.delete(callback)
26
+ end
27
+ end
28
+
29
+ ##
30
+ # @param breadcrumb [Breadcrumb]
31
+ # @return [void]
32
+ def call(breadcrumb)
33
+ @callbacks.each do |callback|
34
+ begin
35
+ should_continue = callback.call(breadcrumb)
36
+ rescue StandardError => e
37
+ @configuration.warn("Error occurred in on_breadcrumb callback: '#{e}'")
38
+ @configuration.warn("on_breadcrumb callback stacktrace: #{e.backtrace.inspect}")
39
+ end
40
+
41
+ # only stop if should_continue is explicity 'false' to allow callbacks
42
+ # to return 'nil'
43
+ if should_continue == false
44
+ breadcrumb.ignore!
45
+ break
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -25,7 +25,7 @@ module Bugsnag
25
25
  # @param url [String]
26
26
  # @return [String]
27
27
  def clean_url(url)
28
- return url if @configuration.meta_data_filters.empty?
28
+ return url if @configuration.meta_data_filters.empty? && @configuration.redacted_keys.empty?
29
29
 
30
30
  uri = URI(url)
31
31
  return url unless uri.query
@@ -43,6 +43,33 @@ module Bugsnag
43
43
  uri.to_s
44
44
  end
45
45
 
46
+ ##
47
+ # @param key [String, #to_s]
48
+ # @return [Boolean]
49
+ def filters_match?(key)
50
+ str = key.to_s
51
+
52
+ matched = @configuration.meta_data_filters.any? do |filter|
53
+ case filter
54
+ when Regexp
55
+ str.match(filter)
56
+ else
57
+ str.include?(filter.to_s)
58
+ end
59
+ end
60
+
61
+ return true if matched
62
+
63
+ @configuration.redacted_keys.any? do |redaction_pattern|
64
+ case redaction_pattern
65
+ when Regexp
66
+ str.match(redaction_pattern)
67
+ when String
68
+ str.downcase == redaction_pattern.downcase
69
+ end
70
+ end
71
+ end
72
+
46
73
  private
47
74
 
48
75
  ##
@@ -54,9 +81,11 @@ module Bugsnag
54
81
  #
55
82
  # @return [Boolean]
56
83
  def deep_filters?
57
- @configuration.meta_data_filters.any? do |filter|
84
+ is_deep_filter = proc do |filter|
58
85
  filter.is_a?(Regexp) && filter.to_s.include?("\\.".freeze)
59
86
  end
87
+
88
+ @configuration.meta_data_filters.any?(&is_deep_filter) || @configuration.redacted_keys.any?(&is_deep_filter)
60
89
  end
61
90
 
62
91
  def clean_string(str)
@@ -137,22 +166,6 @@ module Bugsnag
137
166
  value
138
167
  end
139
168
 
140
- ##
141
- # @param key [String, #to_s]
142
- # @return [Boolean]
143
- def filters_match?(key)
144
- str = key.to_s
145
-
146
- @configuration.meta_data_filters.any? do |filter|
147
- case filter
148
- when Regexp
149
- str.match(filter)
150
- else
151
- str.include?(filter.to_s)
152
- end
153
- end
154
- end
155
-
156
169
  ##
157
170
  # If someone has a Rails filter like /^stuff\.secret/, it won't match
158
171
  # "request.params.stuff.secret", so we try it both with and without the