-
-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing initialized? checks to sentry-rails #1919
Conversation
16b7c39
to
bda43ec
Compare
Can you add a changelog entry too? Thx |
bda43ec
to
f4a4490
Compare
I always forget the changelog :( |
I thought about using GH's release to automatically generate changelogs, but it doesn't fit our release flow (having changelog before releasing). |
@st0012 craft actually supports |
@sl0thentr0py Thanks for your kind words ❤️ |
Sorry to chime in, but the Ruby SDK changelogs are a staple at Sentry. Pls keep this 🚀 |
@@ -3,6 +3,7 @@ module Rails | |||
module ControllerTransaction | |||
def self.included(base) | |||
base.prepend_before_action do |controller| | |||
return unless Sentry.initialized? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code generates a LocalJumpError: unexpected return
error in my install. I'm pulling sentry-ruby
from source to try and mitigate the same problem as in #1885, which shows up in our test environments. (It shows up even though we're not using guard
, so the workaround from that issue didn't work for us)
I'm using Rails 6.1.6
with Ruby 2.7.6p219
Instead, using a basic conditional like this was enough to make our tests pass:
if Sentry.initialized?
Sentry.get_current_scope.set_transaction_name("#{controller.class}##{controller.action_name}", source: :view)
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @sl0thentr0py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof my bad, thx @gareth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug introduced in #1919 see #1919 (comment)
The
at_exit
Sentry.close
call might cause theseSentry.get_current_scope
s to return nil and break some setups.Fixes #1885