Skip to content

feat(contexts): Hide client-related highlights in backend issues - #88539

Merged
s1gr1d merged 2 commits into
masterfrom
sig/issue-details-runtime
Apr 4, 2025
Merged

s1gr1d merged 2 commits into
masterfrom
sig/issue-details-runtime

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Apr 2, 2025 •

Copy link
Copy Markdown
Member

If a backend error is thrown in a Meta-Framework, the issue includes client_os and os in the event context. However, the highlights should only show data relevant to the backend.

Also, the runtime is more important than OS, so it's reordered.

Also fixes an issue in a test from #86857 as client_os is not a context type, but only an alias

fixes: https://github.com/getsentry/projects/issues/801
part of: #85732

Follow-up PR


Before

image

or when it ran locally (server is macOS as well)

image

After

image

or locally:

image

@s1gr1d
s1gr1d requested a review from a team as a code owner April 2, 2025 12:25
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 2, 2025
@s1gr1d
s1gr1d requested a review from scttcper April 2, 2025 12:25
@s1gr1d s1gr1d self-assigned this Apr 2, 2025
contexts: {
client_os: {
type: 'client_os',
type: 'os',

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe I'm missing something here but it seems like client_os is really only an alias and is never used as a type. At least Relay and the SDK only use os

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll need to double check this, what the spec says, if this is a bug in Relay or if this is actually valid according to the spec (having a key different from the type).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, so this is actually correct, nice:

The contexts type can be used to define arbitrary contextual data on the event. It accepts an object of key/value pairs. The key is the “alias” of the context and can be freely chosen. However, as per policy, it should match the type of the context unless there are two values for a type. You can omit type if the key name is the type.

https://develop-git-python3bydefault.sentry.dev/sdk/event-payloads/contexts/

Type should be os, key client_os.

@mydea

mydea commented Apr 2, 2025

Copy link
Copy Markdown
Member

Can we re-order this, showing node version before os?

@s1gr1d

s1gr1d commented Apr 3, 2025

Copy link
Copy Markdown
Member Author

@mydea Changed the ordering of OS and runtime

@scttcper Would appreciate another review on this new commit: 49fe647

@s1gr1d
s1gr1d merged commit b3d3230 into master Apr 4, 2025
@s1gr1d
s1gr1d deleted the sig/issue-details-runtime branch April 4, 2025 07:36
@sentry

sentry Bot commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TestingLibraryElementError: Unable to find an element with the text: Operating System Version. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Object.?(highlightsIconSummary.spec.tsx) View Issue

Did you find this useful? React with a 👍 or 👎

andrewshie-sentry pushed a commit that referenced this pull request Apr 8, 2025
)

If a backend error is thrown in a Meta-Framework, the issue includes
`client_os` and `os` in the event context. However, the highlights
should only show data relevant to the backend.

Also, the runtime is more important than OS, so it's reordered.

Also fixes an issue in a test from
#86857 as `client_os` is not a
context type, but only an alias

fixes: getsentry/projects#801
part of: #85732

**Follow-up PR** 
- #88536

---

### Before


![image](https://github.com/user-attachments/assets/e972c62b-5255-4287-847a-96890590c10d)

or when it ran locally (server is macOS as well)


![image](https://github.com/user-attachments/assets/193c620a-992a-4894-8a4b-789f571b1275)


### After


![image](https://github.com/user-attachments/assets/212b7f3d-35e0-4272-b594-022ab5e64c4c)

or locally:


![image](https://github.com/user-attachments/assets/b5485af1-37ce-4f13-9733-5aaf913a6414)
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 19, 2025

This branch was successfully deployed

1 active deployment
Preview — 49fe6471 Deployed Apr 3, 2025 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants