Skip to content

feat(types): add Response context #874

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

Merged
merged 5 commits into from
Aug 4, 2025
Merged

Conversation

lcian
Copy link
Member

@lcian lcian commented Jul 30, 2025

Adds the Reponse context, which can be attached to events.

The implementation is adapted directly from the one in Relay, minus the inferred_content_type, which as documented here can technically be sent by SDKs but will always be overridden by Relay.

Part of #873

Copy link

github-actions bot commented Jul 30, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 1de6b99

Copy link

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.13%. Comparing base (4c4fc9d) to head (1de6b99).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #874      +/-   ##
==========================================
- Coverage   73.14%   73.13%   -0.01%     
==========================================
  Files          64       64              
  Lines        7365     7366       +1     
==========================================
  Hits         5387     5387              
- Misses       1978     1979       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cursor[bot]

This comment was marked as outdated.

@lcian lcian requested a review from szokeasaurusrex July 30, 2025 13:36
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Nice! Just a few questions:

  • How is this new type supposed to be used? Does not look like we are using it in the SDK, is it something that users are just supposed to know how to set? Or, does the into_context! stuff take care of setting it?
  • Do we anticipate ever needing to add more fields to this struct?

@lcian
Copy link
Member Author

lcian commented Jul 30, 2025

  • How is this new type supposed to be used? Does not look like we are using it in the SDK, is it something that users are just supposed to know how to set? Or, does the into_context! stuff take care of setting it?

I'll make a PR on top of this to use this in the Actix Web integration.
We already capture most of this data using the Request Interface but we're missing the status code.
This way, not only we will report the status code to Sentry, but most importantly a user will be able to filter an error in before_send based on the status code.

Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Lgtm, maybe you could add an example to the changelog, though!

@lcian lcian enabled auto-merge (squash) August 4, 2025 15:59
@lcian lcian merged commit 0336a02 into master Aug 4, 2025
19 checks passed
@lcian lcian deleted the lcian/feat/response-context branch August 4, 2025 16:02
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.

2 participants