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

Ignore JavascriptException on the native side #4232

Merged
merged 5 commits into from
Nov 7, 2024

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Nov 4, 2024

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Replaces the beforeSend string matching filtering with the addIgnoredExceptionForType initialisation option for ignoring the JavascriptException events and avoid sending them twice. This is enforced on captureEvent in the java SDK which relies on comparing the class. This is not affected by obfuscation like the string value returned by getType().

💡 Motivation and Context

Fixes #3126

💚 How did you test it?

Manual testing with the sample app, passing CI checks

Note: I wasn't able to reproduce the duplicated unhandled JS error on obfuscated code (minifyEnabled, proguard) and only verified that the app behaviour hasn't changed.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Thanks

@antonis antonis enabled auto-merge (squash) November 7, 2024 12:33
@antonis antonis merged commit dde9191 into main Nov 7, 2024
54 checks passed
@antonis antonis deleted the antonis/3126-ignore-jsexception branch November 7, 2024 12:33
Copy link
Contributor

github-actions bot commented Nov 7, 2024

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 448.75 ms 441.92 ms -6.83 ms
Size 17.74 MiB 20.08 MiB 2.34 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
70e6261 482.65 ms 495.70 ms 13.05 ms
76d1baf+dirty 335.72 ms 355.52 ms 19.80 ms
22e31b6 396.48 ms 419.64 ms 23.16 ms
fe13591 478.92 ms 480.84 ms 1.92 ms
d197b5c+dirty 338.94 ms 354.87 ms 15.93 ms
ad6c299 375.94 ms 382.02 ms 6.08 ms
abb7058 370.27 ms 389.58 ms 19.31 ms
2ec71da 438.14 ms 460.46 ms 22.32 ms
31fcca2 391.22 ms 414.78 ms 23.56 ms
62a750b 395.96 ms 423.36 ms 27.41 ms

App size

Revision Plain With Sentry Diff
70e6261 17.73 MiB 19.94 MiB 2.21 MiB
76d1baf+dirty 17.73 MiB 20.04 MiB 2.31 MiB
22e31b6 17.73 MiB 19.84 MiB 2.10 MiB
fe13591 17.74 MiB 20.07 MiB 2.34 MiB
d197b5c+dirty 17.73 MiB 20.04 MiB 2.31 MiB
ad6c299 17.73 MiB 19.75 MiB 2.02 MiB
abb7058 17.73 MiB 19.83 MiB 2.10 MiB
2ec71da 17.73 MiB 20.10 MiB 2.37 MiB
31fcca2 17.73 MiB 19.90 MiB 2.17 MiB
62a750b 17.73 MiB 19.93 MiB 2.20 MiB

Copy link
Contributor

github-actions bot commented Nov 7, 2024

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1210.15 ms 1218.21 ms 8.07 ms
Size 2.36 MiB 3.10 MiB 751.37 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d0bf494+dirty 1289.40 ms 1298.40 ms 9.00 ms
5a22220+dirty 1209.49 ms 1220.94 ms 11.45 ms
c398f67+dirty 1219.67 ms 1225.66 ms 5.99 ms
27ef4ee+dirty 1293.52 ms 1296.08 ms 2.56 ms
d8668ce+dirty 1225.18 ms 1228.08 ms 2.90 ms
e73f4ed+dirty 1243.27 ms 1244.52 ms 1.25 ms
3853f43+dirty 1221.82 ms 1242.64 ms 20.82 ms
9c48b2c+dirty 1246.96 ms 1255.73 ms 8.77 ms
70caa60+dirty 1218.27 ms 1230.30 ms 12.03 ms
eb1e19f+dirty 1209.56 ms 1214.94 ms 5.38 ms

App size

Revision Plain With Sentry Diff
d0bf494+dirty 2.36 MiB 2.83 MiB 481.15 KiB
5a22220+dirty 2.36 MiB 2.92 MiB 570.21 KiB
c398f67+dirty 2.36 MiB 3.04 MiB 696.27 KiB
27ef4ee+dirty 2.36 MiB 2.85 MiB 500.03 KiB
d8668ce+dirty 2.36 MiB 3.08 MiB 737.08 KiB
e73f4ed+dirty 2.36 MiB 2.82 MiB 469.44 KiB
3853f43+dirty 2.36 MiB 2.85 MiB 499.81 KiB
9c48b2c+dirty 2.36 MiB 2.85 MiB 495.77 KiB
70caa60+dirty 2.36 MiB 2.83 MiB 479.27 KiB
eb1e19f+dirty 2.36 MiB 3.08 MiB 737.21 KiB

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 473.84 ms 531.96 ms 58.11 ms
Size 7.15 MiB 8.35 MiB 1.20 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
728164b+dirty 335.93 ms 342.94 ms 7.01 ms
5571a20+dirty 359.52 ms 389.80 ms 30.28 ms
76d1baf+dirty 339.02 ms 408.65 ms 69.63 ms
d197b5c+dirty 258.75 ms 313.61 ms 54.86 ms
baa882f+dirty 449.30 ms 540.40 ms 91.10 ms
12427f4+dirty 379.48 ms 400.92 ms 21.44 ms
5446992+dirty 371.61 ms 390.00 ms 18.39 ms
ac41368+dirty 395.91 ms 451.17 ms 55.26 ms
9cd0e9f+dirty 383.65 ms 418.65 ms 35.00 ms
eb1e19f+dirty 391.37 ms 418.27 ms 26.90 ms

App size

Revision Plain With Sentry Diff
728164b+dirty 7.15 MiB 8.12 MiB 997.71 KiB
5571a20+dirty 7.15 MiB 8.20 MiB 1.05 MiB
76d1baf+dirty 7.15 MiB 8.09 MiB 964.41 KiB
d197b5c+dirty 7.15 MiB 8.09 MiB 962.72 KiB
baa882f+dirty 7.15 MiB 8.34 MiB 1.19 MiB
12427f4+dirty 7.15 MiB 8.12 MiB 997.78 KiB
5446992+dirty 7.15 MiB 8.12 MiB 999.45 KiB
ac41368+dirty 7.15 MiB 8.39 MiB 1.24 MiB
9cd0e9f+dirty 7.15 MiB 8.35 MiB 1.20 MiB
eb1e19f+dirty 7.15 MiB 8.35 MiB 1.20 MiB

Copy link
Contributor

github-actions bot commented Nov 7, 2024

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1239.73 ms 1238.38 ms -1.35 ms
Size 2.92 MiB 3.66 MiB 755.48 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d0bf494+dirty 1266.20 ms 1267.52 ms 1.32 ms
5a22220+dirty 1246.18 ms 1249.61 ms 3.43 ms
c398f67+dirty 1227.31 ms 1230.00 ms 2.69 ms
27ef4ee+dirty 1236.41 ms 1244.90 ms 8.49 ms
d8668ce+dirty 1249.70 ms 1242.31 ms -7.39 ms
e73f4ed+dirty 1282.90 ms 1309.30 ms 26.40 ms
3853f43+dirty 1271.74 ms 1278.04 ms 6.30 ms
9c48b2c+dirty 1253.39 ms 1256.30 ms 2.91 ms
70caa60+dirty 1279.08 ms 1281.54 ms 2.46 ms
eb1e19f+dirty 1229.91 ms 1231.63 ms 1.71 ms

App size

Revision Plain With Sentry Diff
d0bf494+dirty 2.92 MiB 3.40 MiB 488.08 KiB
5a22220+dirty 2.92 MiB 3.48 MiB 575.81 KiB
c398f67+dirty 2.92 MiB 3.60 MiB 701.89 KiB
27ef4ee+dirty 2.92 MiB 3.41 MiB 503.72 KiB
d8668ce+dirty 2.92 MiB 3.64 MiB 742.99 KiB
e73f4ed+dirty 2.92 MiB 3.38 MiB 475.71 KiB
3853f43+dirty 2.92 MiB 3.41 MiB 503.54 KiB
9c48b2c+dirty 2.92 MiB 3.41 MiB 499.97 KiB
70caa60+dirty 2.92 MiB 3.39 MiB 486.04 KiB
eb1e19f+dirty 2.92 MiB 3.64 MiB 742.82 KiB

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.

Filtering duplicated Unhandled JS Errors doesn't work with obfuscated class names on Android
2 participants