bugsnag 6.24.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: 8f9bcfd0b8a1fa0f25ff5bb465319cb96f254f3cef1f7aaac847ecd7f624062b
4
- data.tar.gz: 3eb77e9bd754fe86d185dc062b9b41d9c224d0b8901991d75f95f80c22b266f3
3
+ metadata.gz: b0c0062b72786fa763b8b17ff0f72647808c2c0372c08b098b70007acc52dec9
4
+ data.tar.gz: c467bdbbe899f9e6f2ec1bf47071c8f70228f7cac51f292e8b77a6c9724da368
5
5
  SHA512:
6
- metadata.gz: d5f463a241c45255229297447cbc047526db02c04b6cf0ea03905f46a0ba6ada617d0de2d9aeadaa17da5e944f0ddcbe6418c564071331230c50e825b801bea6
7
- data.tar.gz: c27128f59737759e67c028a3984f41f6792746d27c42c7ee4c8820f3d0eda1bbef580c0dde4dbaf1ad63d4433eeeadb6c462344c58c2bcaf4deb5d5f218e54e5
6
+ metadata.gz: c2cd2286a921e1cb2ad6e78e620c097a7a5937be53ebb75f020cc7eaba31505c904315083b545a1f9758ddb14c2e902c8e47e8845eef3a242fd8aec810860496
7
+ data.tar.gz: 15410f4d0280b5abb8f9804a6b66c6d05eed52c025e394ed0fbc642507d7ac64b2cb90db5a1dda0a946143d85dbab4d148dafab88697fa47bb79363d4ff6df3e
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
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
+
4
12
  ## v6.24.1 (30 November 2021)
5
13
 
6
14
  ### Fixes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.24.1
1
+ 6.24.2
@@ -47,6 +47,29 @@ module Bugsnag
47
47
  end
48
48
  end
49
49
 
50
+ ##
51
+ # Do we need to rescue (& notify) in Active Record callbacks?
52
+ #
53
+ # On Rails versions < 4.2, Rails did not raise errors in AR callbacks
54
+ # On Rails version 4.2, a config option was added to control this
55
+ # On Rails version 5.0, the config option was removed and errors in callbacks
56
+ # always bubble up
57
+ #
58
+ # @api private
59
+ def self.rescue_in_active_record_callbacks?
60
+ # Rails 5+ will re-raise errors in callbacks, so we don't need to rescue them
61
+ return false if ::Rails::VERSION::MAJOR > 4
62
+
63
+ # before 4.2, errors were always swallowed, so we need to rescue them
64
+ return true if ::Rails::VERSION::MAJOR < 4
65
+
66
+ # a config option was added in 4.2 to control this, but won't exist in 4.0 & 4.1
67
+ return true unless ActiveRecord::Base.respond_to?(:raise_in_transactional_callbacks)
68
+
69
+ # if the config option is false, we need to rescue and notify
70
+ ActiveRecord::Base.raise_in_transactional_callbacks == false
71
+ end
72
+
50
73
  rake_tasks do
51
74
  require "bugsnag/integrations/rake"
52
75
  load "bugsnag/tasks/bugsnag.rake"
@@ -70,8 +93,10 @@ module Bugsnag
70
93
  end
71
94
 
72
95
  ActiveSupport.on_load(:active_record) do
73
- require "bugsnag/integrations/rails/active_record_rescue"
74
- include Bugsnag::Rails::ActiveRecordRescue
96
+ if Bugsnag::Railtie.rescue_in_active_record_callbacks?
97
+ require "bugsnag/integrations/rails/active_record_rescue"
98
+ include Bugsnag::Rails::ActiveRecordRescue
99
+ end
75
100
  end
76
101
 
77
102
  ActiveSupport.on_load(:active_job) do
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.24.1
4
+ version: 6.24.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-30 00:00:00.000000000 Z
11
+ date: 2022-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby