Skip to content

Conversation

@lucas-zimerman
Copy link
Collaborator

@lucas-zimerman lucas-zimerman commented Jun 25, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Before this change, ignoreErrors was only applied to JavaScript errors. With this PR, Native errors will also be able to be filtered by ignoreErrors.

Since different SDKs apply different approaches to ignoreErrors, I have unified them by following what the JavaScript SDK does.

Usage:

on JS SDK, strings are compared with contains, making it able to seach for substrings, so 1234 will ignore the error this is an error 1234.
Regex filters will continue with the same behaviour on all platforms.

OS Specific changes:

Android

It has a build in ignoreError filter, but string errors doesn't compare substrings but the entire string, making the 1234 example invalid. To fix it, string asserts are transformed into Regex by doing the pattern .*\Q this is my string\E.*, making it behave like the JavaScript contains.

iOS

Since there are no ignoreErrors, we apply those filters on the beforeSend callback, regex errors are filtered by regex objects where string filters behave like the JS implementation.

💡 Motivation and Context

Fixes #4924

💚 How did you test it?

Unit Tests, sample app

📝 Checklist

  • I added tests to verify 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.
  • All tests passing
  • No breaking changes

🔮 Next steps

  • Document ignoreErrors on V7

@github-actions
Copy link
Contributor

github-actions bot commented Jun 25, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 424.37 ms 420.47 ms -3.90 ms
Size 17.75 MiB 19.60 MiB 1.85 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
472960b 418.84 ms 405.38 ms -13.46 ms
3c99746 399.51 ms 429.09 ms 29.58 ms
f870f2d 444.67 ms 449.62 ms 4.95 ms
7eff2d7 420.64 ms 401.86 ms -18.78 ms

App size

Revision Plain With Sentry Diff
472960b 17.75 MiB 19.58 MiB 1.83 MiB
3c99746 17.75 MiB 19.58 MiB 1.83 MiB
f870f2d 17.75 MiB 19.58 MiB 1.83 MiB
7eff2d7 17.75 MiB 19.60 MiB 1.85 MiB

Previous results on branch: lz/v7/ignore-errors

Startup times

Revision Plain With Sentry Diff
000340c 449.20 ms 441.02 ms -8.18 ms
628a490 413.69 ms 399.41 ms -14.27 ms

App size

Revision Plain With Sentry Diff
000340c 17.75 MiB 19.60 MiB 1.85 MiB
628a490 17.75 MiB 19.60 MiB 1.85 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jun 25, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 418.38 ms 410.18 ms -8.20 ms
Size 7.15 MiB 8.35 MiB 1.20 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
3c99746+dirty 400.65 ms 399.59 ms -1.06 ms
7eff2d7+dirty 393.13 ms 426.77 ms 33.65 ms
472960b+dirty 394.39 ms 376.18 ms -18.20 ms
f870f2d+dirty 398.49 ms 434.24 ms 35.75 ms

App size

Revision Plain With Sentry Diff
3c99746+dirty 7.15 MiB 8.34 MiB 1.18 MiB
7eff2d7+dirty 7.15 MiB 8.35 MiB 1.20 MiB
472960b+dirty 7.15 MiB 8.34 MiB 1.18 MiB
f870f2d+dirty 7.15 MiB 8.34 MiB 1.18 MiB

Previous results on branch: lz/v7/ignore-errors

Startup times

Revision Plain With Sentry Diff
628a490+dirty 370.94 ms 368.02 ms -2.92 ms
000340c+dirty 388.30 ms 394.09 ms 5.79 ms

App size

Revision Plain With Sentry Diff
628a490+dirty 7.15 MiB 8.35 MiB 1.20 MiB
000340c+dirty 7.15 MiB 8.35 MiB 1.20 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jun 25, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1221.81 ms 1227.02 ms 5.21 ms
Size 3.19 MiB 4.36 MiB 1.17 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
7eff2d7+dirty 1224.84 ms 1227.94 ms 3.10 ms
3c99746+dirty 1227.65 ms 1228.81 ms 1.16 ms
472960b+dirty 1243.67 ms 1233.57 ms -10.11 ms
f870f2d+dirty 1230.08 ms 1238.88 ms 8.80 ms

App size

Revision Plain With Sentry Diff
7eff2d7+dirty 3.19 MiB 4.36 MiB 1.17 MiB
3c99746+dirty 3.19 MiB 4.35 MiB 1.16 MiB
472960b+dirty 3.19 MiB 4.36 MiB 1.17 MiB
f870f2d+dirty 3.19 MiB 4.36 MiB 1.17 MiB

Previous results on branch: lz/v7/ignore-errors

Startup times

Revision Plain With Sentry Diff
628a490+dirty 1224.94 ms 1237.40 ms 12.46 ms
000340c+dirty 1224.71 ms 1221.85 ms -2.86 ms

App size

Revision Plain With Sentry Diff
628a490+dirty 3.19 MiB 4.36 MiB 1.17 MiB
000340c+dirty 3.19 MiB 4.36 MiB 1.17 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jun 25, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1224.10 ms 1230.41 ms 6.31 ms
Size 2.63 MiB 3.79 MiB 1.16 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
7eff2d7+dirty 1225.34 ms 1234.53 ms 9.19 ms
3c99746+dirty 1215.12 ms 1222.31 ms 7.18 ms
472960b+dirty 1213.96 ms 1222.58 ms 8.62 ms
f870f2d+dirty 1227.18 ms 1232.30 ms 5.12 ms

App size

Revision Plain With Sentry Diff
7eff2d7+dirty 2.63 MiB 3.79 MiB 1.16 MiB
3c99746+dirty 2.63 MiB 3.78 MiB 1.15 MiB
472960b+dirty 2.63 MiB 3.79 MiB 1.15 MiB
f870f2d+dirty 2.63 MiB 3.79 MiB 1.15 MiB

Previous results on branch: lz/v7/ignore-errors

Startup times

Revision Plain With Sentry Diff
628a490+dirty 1223.83 ms 1230.18 ms 6.35 ms
000340c+dirty 1207.56 ms 1210.43 ms 2.87 ms

App size

Revision Plain With Sentry Diff
628a490+dirty 2.63 MiB 3.79 MiB 1.16 MiB
000340c+dirty 2.63 MiB 3.79 MiB 1.16 MiB

@lucas-zimerman lucas-zimerman changed the title (WIP): ignoreErrors now works on Native fix: ignoreErrors now works on Native Jun 27, 2025
@lucas-zimerman lucas-zimerman marked this pull request as ready for review June 27, 2025 08:34
@lucas-zimerman lucas-zimerman requested a review from antonis as a code owner June 27, 2025 08:34
Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

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

Awesome work @lucas-zimerman 🙇
The changes LGTM and work as expected 🎉

Just added two minor suggestions.

Co-authored-by: Antonis Lilis <antonis.lilis@gmail.com>
@antonis antonis merged commit 761d3b1 into v7 Jun 27, 2025
83 of 84 checks passed
@antonis antonis deleted the lz/v7/ignore-errors branch June 27, 2025 13:21
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.

3 participants