{"action":"created","issue":{"url":"https://api.github.com/repos/bugsnag/bugsnag-ruby/issues/179","labels_url":"https://api.github.com/repos/bugsnag/bugsnag-ruby/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-ruby/issues/179/comments","events_url":"https://api.github.com/repos/bugsnag/bugsnag-ruby/issues/179/events","html_url":"https://github.com/bugsnag/bugsnag-ruby/issues/179","id":50878338,"number":179,"title":"Ensure we don't double-notify exceptions in `after_rollback` or `after_commit`","user":{"login":"loopj","id":104009,"avatar_url":"https://avatars.githubusercontent.com/u/104009?v=3","gravatar_id":"","url":"https://api.github.com/users/loopj","html_url":"https://github.com/loopj","followers_url":"https://api.github.com/users/loopj/followers","following_url":"https://api.github.com/users/loopj/following{/other_user}","gists_url":"https://api.github.com/users/loopj/gists{/gist_id}","starred_url":"https://api.github.com/users/loopj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loopj/subscriptions","organizations_url":"https://api.github.com/users/loopj/orgs","repos_url":"https://api.github.com/users/loopj/repos","events_url":"https://api.github.com/users/loopj/events{/privacy}","received_events_url":"https://api.github.com/users/loopj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-03T19:06:40Z","updated_at":"2015-02-18T03:30:30Z","closed_at":null,"body":"Rails 4.2 no longer swallows exceptions raised in `after_rollback` or `after_commit` callbacks, we should check if our special handling of these (`Bugsnag::Rails::ActiveRecordRescue`) will cause any problems in rails 4.2."},"comment":{"url":"https://api.github.com/repos/bugsnag/bugsnag-ruby/issues/comments/74805450","html_url":"https://github.com/bugsnag/bugsnag-ruby/issues/179#issuecomment-74805450","issue_url":"https://api.github.com/repos/bugsnag/bugsnag-ruby/issues/179","id":74805450,"user":{"login":"lowensk","id":897086,"avatar_url":"https://avatars.githubusercontent.com/u/897086?v=3","gravatar_id":"","url":"https://api.github.com/users/lowensk","html_url":"https://github.com/lowensk","followers_url":"https://api.github.com/users/lowensk/followers","following_url":"https://api.github.com/users/lowensk/following{/other_user}","gists_url":"https://api.github.com/users/lowensk/gists{/gist_id}","starred_url":"https://api.github.com/users/lowensk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowensk/subscriptions","organizations_url":"https://api.github.com/users/lowensk/orgs","repos_url":"https://api.github.com/users/lowensk/repos","events_url":"https://api.github.com/users/lowensk/events{/privacy}","received_events_url":"https://api.github.com/users/lowensk/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T03:30:30Z","updated_at":"2015-02-18T03:30:30Z","body":"It doesn't appear that this will be an issue, because Bugsnag::Rails::ActiveRecordRescue monkey patches a method called run_callbacks. Note the following caller output for 4.1.8:\r\n\r\n```\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:424:in `block in make_lambda'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:253:in `call'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:253:in `block in simple'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in `call'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in `run_callbacks'\r\n/Users/keegan/code/bugsnag-ruby/lib/bugsnag/rails/active_record_rescue.rb:11:in `run_callbacks'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:296:in `committed!'\r\n```\r\n\r\nIn 4.2, active_support/callbacks.rb has changed its internal behavior:\r\n\r\n\r\n```\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:427:in `block in make_lambda'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:260:in `call'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:260:in `block in simple'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_commit_callbacks'\r\n/Users/keegan/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/transactions.rb:314:in `committed!'\r\n```\r\n\r\nNote that that in 4.2.0 the call to `run_callbacks` has been replaced with a call to `_run_commit_callbacks`, which then calls  `_run_callbacks` — if in a future version, the internal implementation went back to using a method named `run_callbacks`, we would have to worry about the double-notify issue."}}