Skip to content
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

Return value from 'perform_action' when initialized #1966

Merged
merged 3 commits into from
Dec 30, 2022

Conversation

ronocod
Copy link
Contributor

@ronocod ronocod commented Dec 13, 2022

We use ActionCable::Channel::Base#perform_action in our Action Cable testing and would like to use its return value as part of those tests. At the minute, when the SDK is not initialized then this works OK, as the return value of block.call is immediately returned:

return block.call unless Sentry.initialized?

However, if we initialize the SDK, then the return value is swallowed. This change ensures that the result of block.call is returned in all situations, apart from when an error is raised in the block.

@codecov-commenter
Copy link

codecov-commenter commented Dec 30, 2022

Codecov Report

Base: 98.04% // Head: 96.71% // Decreases project coverage by -1.33% ⚠️

Coverage data is based on head (3c9858f) compared to base (dce8ef0).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1966      +/-   ##
==========================================
- Coverage   98.04%   96.71%   -1.34%     
==========================================
  Files         157      129      -28     
  Lines        9826     8422    -1404     
==========================================
- Hits         9634     8145    -1489     
- Misses        192      277      +85     
Impacted Files Coverage Δ
sentry-rails/lib/sentry/rails/railtie.rb 25.33% <0.00%> (-72.00%) ⬇️
sentry-rails/lib/sentry/rails/tracing.rb 34.21% <0.00%> (-65.79%) ⬇️
...entry-rails/lib/sentry/rails/capture_exceptions.rb 34.61% <0.00%> (-65.39%) ⬇️
sentry-rails/lib/sentry/rails/active_job.rb 39.47% <0.00%> (-60.53%) ⬇️
sentry-rails/lib/sentry/rails/backtrace_cleaner.rb 47.05% <0.00%> (-52.95%) ⬇️
.../lib/sentry/rails/rescued_exception_interceptor.rb 50.00% <0.00%> (-50.00%) ⬇️
...ntry/rails/tracing/action_controller_subscriber.rb 55.55% <0.00%> (-44.45%) ⬇️
...ls/lib/sentry/rails/tracing/abstract_subscriber.rb 37.03% <0.00%> (-37.04%) ⬇️
.../sentry/rails/tracing/active_storage_subscriber.rb 63.63% <0.00%> (-36.37%) ⬇️
...b/sentry/rails/tracing/active_record_subscriber.rb 69.23% <0.00%> (-30.77%) ⬇️
... and 33 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, just 2 small comments 👍

sentry-rails/lib/sentry/rails/action_cable.rb Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@st0012 st0012 added this to the 5.8.0 milestone Dec 30, 2022
@st0012
Copy link
Collaborator

st0012 commented Dec 30, 2022

Rebasing master should resolve the CI issue.

@st0012 st0012 merged commit 2d9d844 into getsentry:master Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants