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

fix: set default Scope._transaction_info value to None #3641

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

Conversation

andrewsapw
Copy link

In #1490, the ._transaction_info property was added to the Scope class. However, there are some issues with this property:

  • It causes the error transaction_info: Discarded unknown attribute in older versions of the UI.
  • There is inconsistency in how the field is handled. Although it is marked as Mapping[str, str], in some places (for example, here), it is checked against None.

This PR sets the default value of Scope._transaction_info to None.

@andrewsapw andrewsapw force-pushed the fix-default-scope-transaction-info branch from f94c605 to 21344e4 Compare October 10, 2024 13:43
@szokeasaurusrex
Copy link
Member

@andrewsapw Could you please help me understand the problem you are experiencing?

It causes the error transaction_info: Discarded unknown attribute in older versions of the UI.

Regarding this error, could you please share a screenshot of the error message (or a link to the page, if you are using Sentry's SaaS offering)?

There is inconsistency in how the field is handled. Although it is marked as Mapping[str, str], in some places (for example, here), it is checked against None.

We can likely remove these checks against None, unless we can find somewhere where the field is set to None.

@andrewsapw
Copy link
Author

andrewsapw commented Oct 22, 2024

@szokeasaurusrex of course! Screenshot of the error:
image

@szokeasaurusrex
Copy link
Member

@andrewsapw Could you please also share a code snippet that reproduces this issue? And what version of Sentry self-hosted are you using?

@andrewsapw
Copy link
Author

@szokeasaurusrex , example of code that reproduces this issue:

sentry_sdk.capture_message("[INFO] Test .capture_message", level="info")

Version of Sentry: 22.6.0 e68da5c

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.61%. Comparing base (fe4b88b) to head (92967cd).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3641      +/-   ##
==========================================
- Coverage   79.98%   79.61%   -0.37%     
==========================================
  Files         139      139              
  Lines       15445    15451       +6     
  Branches     2624     2627       +3     
==========================================
- Hits        12353    12301      -52     
- Misses       2219     2280      +61     
+ Partials      873      870       -3     
Files with missing lines Coverage Δ
sentry_sdk/scope.py 86.19% <100.00%> (+0.25%) ⬆️

... and 6 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.

3 participants