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

Prevent Hub from having nil scope and client #2402

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

st0012
Copy link
Collaborator

@st0012 st0012 commented Sep 15, 2024

Hub#pop_scope currently can cause a Hub to have a nil scope and client, which would highly likely lead of errors. For example, Hub#configuration would simply cause NoMethodError.

This commit prevents that from ever happening by making sure that Hub#pop_scope would at least leave a brand new scope and the old client on the stack.

`Hub#pop_scope` currently can cause a Hub to have a nil scope and client,
which would highly likely lead of errors. For example, `Hub#configuration`
would simply cause `NoMethodError`.

This commit prevents that from ever happening by making sure that `Hub#pop_scope`
would at least leave a brand new scope and the old client on the stack.
Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.68%. Comparing base (c3bcfa0) to head (33c73f0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2402      +/-   ##
==========================================
- Coverage   98.69%   98.68%   -0.01%     
==========================================
  Files         210      210              
  Lines       13922    13925       +3     
==========================================
+ Hits        13740    13742       +2     
- Misses        182      183       +1     
Components Coverage Δ
sentry-ruby 99.06% <100.00%> (+<0.01%) ⬆️
sentry-rails 97.34% <ø> (ø)
sentry-sidekiq 97.07% <ø> (ø)
sentry-resque 96.79% <ø> (-0.33%) ⬇️
sentry-delayed_job 98.92% <ø> (ø)
sentry-opentelemetry 100.00% <ø> (ø)
Files with missing lines Coverage Δ
sentry-ruby/lib/sentry/hub.rb 98.82% <100.00%> (-0.58%) ⬇️
sentry-ruby/spec/sentry/hub_spec.rb 96.90% <100.00%> (ø)

... and 2 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant