-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(inbound-filter): Fix react hydration errors message condition #45364
Conversation
Codecov Report
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
|
@@ -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}" |
There was a problem hiding this comment.
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}"
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Unit test for getsentry/sentry#45364.
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