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

Fix ensure session is updated using configureScope #2846

Merged
merged 5 commits into from Jul 18, 2023

Conversation

markushi
Copy link
Member

@markushi markushi commented Jul 18, 2023

📜 Description

Use configureScope instead of withScope, as it doesn't (partially) deep-copy the scope.
Doesn't really seem to be a problem as scope.session is never deep-copied.

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • 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.
  • 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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 18, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 309.69 ms 311.42 ms 1.72 ms
Size 1.72 MiB 2.29 MiB 574.68 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0310da5 381.20 ms 404.50 ms 23.30 ms
8820c5c 330.60 ms 416.86 ms 86.26 ms
dc67004 273.86 ms 346.37 ms 72.51 ms
3baa73f 267.45 ms 388.30 ms 120.85 ms
496bdfd 301.22 ms 343.96 ms 42.73 ms
9246ed4 275.63 ms 321.31 ms 45.69 ms
c03a05e 390.40 ms 419.35 ms 28.94 ms
adf8fe3 300.49 ms 357.36 ms 56.87 ms
caf50ec 302.36 ms 325.25 ms 22.89 ms
f274c79 313.96 ms 355.96 ms 42.00 ms

App size

Revision Plain With Sentry Diff
0310da5 1.72 MiB 2.28 MiB 573.45 KiB
8820c5c 1.72 MiB 2.28 MiB 571.82 KiB
dc67004 1.72 MiB 2.28 MiB 573.45 KiB
3baa73f 1.72 MiB 2.29 MiB 575.52 KiB
496bdfd 1.72 MiB 2.28 MiB 571.82 KiB
9246ed4 1.72 MiB 2.28 MiB 572.22 KiB
c03a05e 1.72 MiB 2.29 MiB 574.43 KiB
adf8fe3 1.72 MiB 2.29 MiB 575.24 KiB
caf50ec 1.72 MiB 2.29 MiB 575.24 KiB
f274c79 1.72 MiB 2.29 MiB 575.01 KiB

Previous results on branch: fix/use-configure-scope

Startup times

Revision Plain With Sentry Diff
f4bdef7 306.75 ms 384.10 ms 77.35 ms
bca33e9 284.82 ms 356.62 ms 71.80 ms
b3ca704 296.43 ms 350.08 ms 53.65 ms
5050455 369.59 ms 405.11 ms 35.52 ms

App size

Revision Plain With Sentry Diff
f4bdef7 1.72 MiB 2.29 MiB 574.68 KiB
bca33e9 1.72 MiB 2.29 MiB 574.68 KiB
b3ca704 1.72 MiB 2.29 MiB 574.68 KiB
5050455 1.72 MiB 2.29 MiB 574.68 KiB

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (beba014) 81.31% compared to head (a93f2b7) 81.31%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2846   +/-   ##
=========================================
  Coverage     81.31%   81.31%           
  Complexity     4619     4619           
=========================================
  Files           352      352           
  Lines         17030    17030           
  Branches       2302     2302           
=========================================
  Hits          13848    13848           
  Misses         2232     2232           
  Partials        950      950           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@markushi markushi requested a review from romtsn July 18, 2023 12:55
CHANGELOG.md Outdated Show resolved Hide resolved
@markushi markushi merged commit d0c08e7 into main Jul 18, 2023
21 checks passed
@markushi markushi deleted the fix/use-configure-scope branch July 18, 2023 17:04
*/
public static SentryId captureEnvelope(final @NotNull byte[] envelopeData) throws Exception {
@Nullable
public static SentryId captureEnvelope(final @NotNull byte[] envelopeData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The return should not be nullable, but rather SentryId.EMPTY_ID as every other capture method, so the caller does not have to handle NPEs.

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.

None yet

3 participants