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

feat(issues): Use title from React caused errors #72593

Merged
merged 4 commits into from
Jun 13, 2024

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Jun 12, 2024

Starting with React 19, errors can include a cause error. Instead of using the generic Error title, we can use the title from the cause error, thus, making each issue unique.

This design shows what the Issue Stream looks like now vs after this change:
image

Starting with React 19, hydration errors include a `cause` error. Instead of using the hydration generic title we can use the title from the `cause` error.

This makes all hydration errors titled differently, thus, being useful for investigation.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 12, 2024
@eps1lon
Copy link

eps1lon commented Jun 12, 2024

Why is this specific to React hydration errors? Error.prototype.cause is standardized nowadays so it seems to me it shouldn't be special cased for React.

@armenzg
Copy link
Member Author

armenzg commented Jun 12, 2024

Why is this specific to React hydration errors? Error.prototype.cause is standardized nowadays so it seems to me it shouldn't be special cased for React.

It would take more time to get the data to determine the extent of the impact of the change. I am currently investigating getting the data.

@armenzg armenzg self-assigned this Jun 12, 2024
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.

Project coverage is 78.05%. Comparing base (8a09244) to head (a2a76d1).
Report is 22 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #72593       +/-   ##
===========================================
+ Coverage   55.17%   78.05%   +22.88%     
===========================================
  Files        6582     6596       +14     
  Lines      293476   293958      +482     
  Branches    50641    50705       +64     
===========================================
+ Hits       161911   229440    +67529     
+ Misses     127476    58261    -69215     
- Partials     4089     6257     +2168     
Files Coverage Δ
src/sentry/eventtypes/error.py 96.42% <100.00%> (+16.79%) ⬆️
src/sentry/grouping/strategies/newstyle.py 97.15% <95.00%> (+53.67%) ⬆️
src/sentry/interfaces/exception.py 76.51% <42.85%> (+28.95%) ⬆️

... and 2053 files with indirect coverage changes

@eps1lon
Copy link

eps1lon commented Jun 12, 2024

Makes sense. React uses cause in other places as well e.g. for "There was an error during concurrent rendering but React was able to recover [...]".

@armenzg armenzg marked this pull request as ready for review June 12, 2024 17:45
@armenzg armenzg requested review from a team as code owners June 12, 2024 17:45
@armenzg armenzg requested a review from vartec June 12, 2024 17:45
@armenzg armenzg changed the title feat(grouping): Use title from cause errors from React hydration errors feat(grouping): Use title from React caused errors Jun 12, 2024
@armenzg armenzg changed the title feat(grouping): Use title from React caused errors feat(issues): Use title from React caused errors Jun 12, 2024
@armenzg armenzg requested review from vartec, a team and AbhiPrasad June 12, 2024 20:12
@armenzg armenzg enabled auto-merge (squash) June 13, 2024 15:35
@armenzg armenzg merged commit d344fa9 into master Jun 13, 2024
50 of 51 checks passed
@armenzg armenzg deleted the feat/hydration-errors/react-19/armenzg branch June 13, 2024 16:18
@lobsterkatie
Copy link
Member

@eps1lon - It's not always clear whether we want to use cause. For example, in our codebase we attach generic API errors as the cause of various more specific errors, and the latter are what we want to use for titling and grouping.

For lots more on this, see #64088 and the various issues it links to.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants