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

Filter strings that cannot be parsed as Regex no longer cause an SDK crash #4213

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

adinauer
Copy link
Member

📜 Description

Fix exception when creating FilterString from string that cannot be parsed as regex.
This was the case e.g. for ignoredErrors, ignoredTransactions, ignoredCheckIns
Catch exception from Pattern.compile and skip using the pattern in that case.

💡 Motivation and Context

Fixes #4212

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Feb 26, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 369.08 ms 416.66 ms 47.58 ms
Size 1.58 MiB 2.21 MiB 641.82 KiB

Previous results on branch: fix/filter-string-regex-error

Startup times

Revision Plain With Sentry Diff
86bce89 382.34 ms 425.34 ms 43.00 ms

App size

Revision Plain With Sentry Diff
86bce89 1.58 MiB 2.21 MiB 641.82 KiB

.getOptions()
.getLogger()
.log(
SentryLevel.DEBUG,
Copy link
Member

Choose a reason for hiding this comment

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

maybe worth raising the level to Warning?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could also be intentional that a filter String isn't meant as a regex and just contains chars not applicable for a regex. I wouldn't consider that something worth WARNING about.

@adinauer adinauer merged commit c1a567b into main Feb 26, 2025
35 checks passed
@adinauer adinauer deleted the fix/filter-string-regex-error branch February 26, 2025 13:56
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.

Defining an ignored error that is not a valid regular expression breaks Sentry integration
2 participants