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(inbound-filter): Fix react hydration errors message condition #45364

Conversation

priscilawebdev
Copy link
Member

Relay was not filtering out react hydration errors events because the relay message condition didn't contain *message*

This PR fixes the issue.

Related to #45188

@priscilawebdev priscilawebdev requested a review from a team March 3, 2023 12:17
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 3, 2023
@priscilawebdev priscilawebdev enabled auto-merge (squash) March 3, 2023 12:17
@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #45364 (03968ef) into master (dfe56ae) will decrease coverage by 3.22%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #45364      +/-   ##
==========================================
- Coverage   80.23%   77.02%   -3.22%     
==========================================
  Files        4724     4720       -4     
  Lines      198817   198688     -129     
  Branches    12006    12006              
==========================================
- Hits       159529   153045    -6484     
- Misses      39026    45381    +6355     
  Partials      262      262              
Impacted Files Coverage Δ
src/sentry/relay/config/__init__.py 98.70% <ø> (ø)
static/app/data/forms/inboundFilters.tsx 100.00% <ø> (ø)
...pp/utils/analytics/trackAdvancedAnalyticsEvent.tsx 100.00% <ø> (ø)
static/app/views/onboarding/index.tsx 62.19% <ø> (+0.74%) ⬆️
static/app/views/onboarding/setupDocs.tsx 59.13% <ø> (ø)
static/app/views/projectInstall/platform.tsx 90.56% <ø> (ø)
.../project/projectFilters/projectFiltersSettings.tsx 87.95% <ø> (ø)
src/sentry/web/frontend/oauth_authorize.py 15.38% <0.00%> (-77.70%) ⬇️
src/sentry/testutils/helpers/query.py 21.05% <0.00%> (-73.69%) ⬇️
...rc/sentry/api/endpoints/project_stacktrace_link.py 16.83% <0.00%> (-71.94%) ⬇️
... and 407 more

@priscilawebdev priscilawebdev requested a review from jjbayer March 3, 2023 12:28
RaduW
RaduW previously requested changes Mar 3, 2023
@@ -125,7 +125,7 @@ def get_filter_settings(project: Project) -> Mapping[str, Any]:
# 423 - There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
# 425 - Text content does not match server-rendered HTML.
error_messages += [
"https://reactjs.org/docs/error-decoder.html?invariant={418,419,422,423,425}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a regex ?
If it is a regex I don't think it is correct
if you want to select "https://..... =" followed by one of the numbers than you would need something like:

https://reactjs.org/docs/error-decoder.html\?invariant=(418|419|422|423|425){1}

which in python you can write as:

# normal string
error_message = "https://reactjs.org/docs/error-decoder.html\\?invariant=(418|419|422|423|425){1}"
# raw string (no double backslash)
error_message = r"https://reactjs.org/docs/error-decoder.html\?invariant=(418|419|422|423|425){1}"

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested it with Joris in Rust and it works

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a glob, not a regex.

@priscilawebdev priscilawebdev dismissed RaduW’s stale review March 3, 2023 12:41

afaik is not a regex Radu

@priscilawebdev priscilawebdev merged commit f706a95 into master Mar 3, 2023
@priscilawebdev priscilawebdev deleted the fix/inbound-filters-fix-react-hydration-errors-message-condition branch March 3, 2023 13:01
jjbayer added a commit to getsentry/relay that referenced this pull request Mar 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2023
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.

5 participants