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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Symbolicate error.cause on debug builds #3920

Merged
merged 5 commits into from
Jul 5, 2024

Conversation

lucas-zimerman
Copy link
Collaborator

@lucas-zimerman lucas-zimerman commented Jun 28, 2024

馃摙 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

馃摐 Description

we were limited to only parse the stack-trace of the original error, with this change, we will parse the error and the cause of it.

馃挕 Motivation and Context

Close: #2118

The changes were made using in regard to what Sentry JavaScript currently support (an error with a cause error, anything else is discarded by the SDK so I limited the scope to only parse the original error and the cause of the original error)

馃挌 How did you test it?

Unit test, and also with an app:

Before: https://sentry-sdks.sentry.io/issues/5546274920/

After: https://sentry-sdks.sentry.io/issues/5548578775/

馃摑 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
Contributor

github-actions bot commented Jun 28, 2024

Android (legacy) Performance metrics 馃殌

Plain With Sentry Diff
Startup time 434.77 ms 467.16 ms 32.39 ms
Size 17.73 MiB 19.95 MiB 2.21 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
62a750b 395.96 ms 423.36 ms 27.41 ms
8900e1a+dirty 430.68 ms 456.13 ms 25.44 ms
70e6261 482.65 ms 495.70 ms 13.05 ms
abb7058 370.27 ms 389.58 ms 19.31 ms
5446992 403.40 ms 426.70 ms 23.30 ms
80b2ce3 385.02 ms 387.36 ms 2.34 ms
3853f43 329.68 ms 346.32 ms 16.64 ms
728164b 414.34 ms 449.22 ms 34.88 ms
31fcca2 391.22 ms 414.78 ms 23.56 ms
acadc0f+dirty 373.24 ms 381.51 ms 8.27 ms

App size

Revision Plain With Sentry Diff
62a750b 17.73 MiB 19.93 MiB 2.20 MiB
8900e1a+dirty 17.73 MiB 19.75 MiB 2.01 MiB
70e6261 17.73 MiB 19.94 MiB 2.21 MiB
abb7058 17.73 MiB 19.83 MiB 2.10 MiB
5446992 17.73 MiB 19.85 MiB 2.12 MiB
80b2ce3 17.73 MiB 19.75 MiB 2.02 MiB
3853f43 17.73 MiB 19.81 MiB 2.08 MiB
728164b 17.73 MiB 19.85 MiB 2.12 MiB
31fcca2 17.73 MiB 19.90 MiB 2.17 MiB
acadc0f+dirty 17.73 MiB 19.75 MiB 2.01 MiB

Previous results on branch: fix/nested-exception

Startup times

Revision Plain With Sentry Diff
2e61619 460.33 ms 488.52 ms 28.20 ms

App size

Revision Plain With Sentry Diff
2e61619 17.73 MiB 19.94 MiB 2.21 MiB

Copy link
Contributor

github-actions bot commented Jun 28, 2024

Android (new) Performance metrics 馃殌

Plain With Sentry Diff
Startup time 367.51 ms 389.33 ms 21.82 ms
Size 7.15 MiB 8.22 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
575f9da+dirty 337.15 ms 370.47 ms 33.32 ms
9c48b2c+dirty 270.82 ms 321.12 ms 50.30 ms
5446992+dirty 371.61 ms 390.00 ms 18.39 ms
86d6d2c+dirty 267.21 ms 325.24 ms 58.04 ms
15c80ab+dirty 276.38 ms 327.54 ms 51.17 ms
abb7058+dirty 320.78 ms 324.08 ms 3.30 ms
31fcca2+dirty 366.64 ms 395.78 ms 29.14 ms
4a6664f+dirty 357.02 ms 394.91 ms 37.89 ms
d361d38+dirty 257.72 ms 318.76 ms 61.04 ms
34aba08+dirty 331.79 ms 376.69 ms 44.91 ms

App size

Revision Plain With Sentry Diff
575f9da+dirty 7.15 MiB 8.10 MiB 979.68 KiB
9c48b2c+dirty 7.15 MiB 8.07 MiB 947.16 KiB
5446992+dirty 7.15 MiB 8.12 MiB 999.45 KiB
86d6d2c+dirty 7.15 MiB 8.09 MiB 962.69 KiB
15c80ab+dirty 7.15 MiB 8.09 MiB 966.13 KiB
abb7058+dirty 7.15 MiB 8.10 MiB 980.40 KiB
31fcca2+dirty 7.15 MiB 8.18 MiB 1.03 MiB
4a6664f+dirty 7.15 MiB 8.22 MiB 1.07 MiB
d361d38+dirty 7.15 MiB 8.08 MiB 959.34 KiB
34aba08+dirty 7.15 MiB 8.07 MiB 946.13 KiB

Copy link
Contributor

github-actions bot commented Jun 28, 2024

iOS (legacy) Performance metrics 馃殌

Plain With Sentry Diff
Startup time 1232.49 ms 1233.12 ms 0.64 ms
Size 2.36 MiB 3.04 MiB 698.65 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9c48b2c+dirty 1246.96 ms 1255.73 ms 8.77 ms
2534337+dirty 1225.08 ms 1230.26 ms 5.17 ms
22e31b6+dirty 1253.62 ms 1265.96 ms 12.34 ms
d197b5c+dirty 1217.61 ms 1242.66 ms 25.05 ms
62a750b+dirty 1216.60 ms 1229.14 ms 12.54 ms
457e29f+dirty 1253.94 ms 1269.18 ms 15.24 ms
70e6261+dirty 1220.09 ms 1230.04 ms 9.95 ms
12427f4+dirty 1267.15 ms 1271.30 ms 4.15 ms
4cc5c27+dirty 1211.45 ms 1214.60 ms 3.16 ms
15c80ab+dirty 1223.74 ms 1228.96 ms 5.22 ms

App size

Revision Plain With Sentry Diff
9c48b2c+dirty 2.36 MiB 2.85 MiB 495.77 KiB
2534337+dirty 2.36 MiB 2.88 MiB 525.47 KiB
22e31b6+dirty 2.36 MiB 2.87 MiB 520.67 KiB
d197b5c+dirty 2.36 MiB 2.82 MiB 462.86 KiB
62a750b+dirty 2.36 MiB 2.92 MiB 570.00 KiB
457e29f+dirty 2.36 MiB 2.87 MiB 520.67 KiB
70e6261+dirty 2.36 MiB 3.03 MiB 680.42 KiB
12427f4+dirty 2.36 MiB 2.88 MiB 530.38 KiB
4cc5c27+dirty 2.36 MiB 3.04 MiB 698.52 KiB
15c80ab+dirty 2.36 MiB 2.83 MiB 474.49 KiB

Previous results on branch: fix/nested-exception

Startup times

Revision Plain With Sentry Diff
2e61619+dirty 1219.75 ms 1220.61 ms 0.86 ms

App size

Revision Plain With Sentry Diff
2e61619+dirty 2.36 MiB 3.04 MiB 698.46 KiB

Copy link
Contributor

github-actions bot commented Jun 28, 2024

iOS (new) Performance metrics 馃殌

Plain With Sentry Diff
Startup time 1242.34 ms 1246.67 ms 4.33 ms
Size 2.92 MiB 3.61 MiB 705.59 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9c48b2c+dirty 1253.39 ms 1256.30 ms 2.91 ms
2534337+dirty 1220.87 ms 1221.47 ms 0.60 ms
22e31b6+dirty 1276.55 ms 1278.12 ms 1.57 ms
d197b5c+dirty 1234.80 ms 1249.20 ms 14.40 ms
62a750b+dirty 1228.12 ms 1230.53 ms 2.41 ms
457e29f+dirty 1256.71 ms 1258.50 ms 1.79 ms
70e6261+dirty 1224.90 ms 1231.02 ms 6.12 ms
12427f4+dirty 1224.90 ms 1231.40 ms 6.50 ms
4cc5c27+dirty 1220.43 ms 1215.13 ms -5.30 ms
15c80ab+dirty 1248.41 ms 1251.24 ms 2.83 ms

App size

Revision Plain With Sentry Diff
9c48b2c+dirty 2.92 MiB 3.41 MiB 499.97 KiB
2534337+dirty 2.92 MiB 3.43 MiB 529.76 KiB
22e31b6+dirty 2.92 MiB 3.43 MiB 524.74 KiB
d197b5c+dirty 2.92 MiB 3.37 MiB 464.41 KiB
62a750b+dirty 2.92 MiB 3.48 MiB 575.59 KiB
457e29f+dirty 2.92 MiB 3.43 MiB 524.75 KiB
70e6261+dirty 2.92 MiB 3.59 MiB 686.11 KiB
12427f4+dirty 2.92 MiB 3.44 MiB 533.29 KiB
4cc5c27+dirty 2.92 MiB 3.61 MiB 705.47 KiB
15c80ab+dirty 2.92 MiB 3.39 MiB 481.56 KiB

Previous results on branch: fix/nested-exception

Startup times

Revision Plain With Sentry Diff
2e61619+dirty 1234.66 ms 1235.63 ms 0.97 ms

App size

Revision Plain With Sentry Diff
2e61619+dirty 2.92 MiB 3.61 MiB 705.15 KiB

@lucas-zimerman lucas-zimerman marked this pull request as ready for review June 28, 2024 17:09
@lucas-zimerman lucas-zimerman changed the title Feat: Serialize cause error on debug builds Fix: Serialize cause error on debug builds Jun 28, 2024
@krystofwoldrich krystofwoldrich changed the title Fix: Serialize cause error on debug builds Fix: Symbolicate error.cause on debug builds Jun 28, 2024
*/
function getExceptionGroup(originalException: ErrorLike): ErrorLike[] {
const errorGroup: ErrorLike[] = [originalException];
const cause = (originalException as { cause?: unknown }).cause;
Copy link
Member

Choose a reason for hiding this comment

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

We have to walk the tree of causes. It can have more than one layer.

erorr3
error2.cause = error3
error.cause = error2

@krystofwoldrich
Copy link
Member

The lint job is failing, please run yarn fix.

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.

Thank you for the additional tests, makes it much easier to review.

馃殌 Looks good.

@krystofwoldrich krystofwoldrich merged commit 97caefa into main Jul 5, 2024
60 of 61 checks passed
@krystofwoldrich krystofwoldrich deleted the fix/nested-exception branch July 5, 2024 09:58
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.

Linked error are not symbolicated in Debug builds
2 participants