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

Start a session after init if AutoSessionTracking is enabled #2356

Merged
merged 17 commits into from Dec 13, 2022

Conversation

markushi
Copy link
Member

@markushi markushi commented Nov 14, 2022

Android-only, on top of that ensure that the LifecycleWatcher handles the existing session correctly.

📜 Description

Right now a session on Android is automatically created in via LifecycleWatcher at the onStart callback. If e.g. a crash happens beforehand, there is no session and thus it can't be marked as Crashed.

💡 Motivation and Context

Fixes #2241

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

Android-only, on top of that ensure that the LifecycleWatcher handles
the existing session correctly
@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2022

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 90688a2

@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2022

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 346.04 ms 362.46 ms 16.42 ms
Size 1.73 MiB 2.33 MiB 613.02 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
81a1a6c 328.73 ms 421.28 ms 92.55 ms
ecf9680 326.55 ms 360.26 ms 33.71 ms
ecf9680 303.12 ms 346.35 ms 43.23 ms
38e4f11 358.20 ms 433.73 ms 75.53 ms
703d523 330.27 ms 377.66 ms 47.39 ms
81a1a6c 294.04 ms 341.19 ms 47.15 ms
ecf9680 321.55 ms 385.52 ms 63.97 ms
4a9c176 320.62 ms 334.68 ms 14.06 ms
3695453 301.78 ms 371.14 ms 69.36 ms
b85d8aa 289.35 ms 335.92 ms 46.56 ms

App size

Revision Plain With Sentry Diff
81a1a6c 1.73 MiB 2.32 MiB 612.47 KiB
ecf9680 1.73 MiB 2.32 MiB 612.39 KiB
ecf9680 1.73 MiB 2.32 MiB 612.39 KiB
38e4f11 1.73 MiB 2.32 MiB 609.82 KiB
703d523 1.73 MiB 2.33 MiB 613.23 KiB
81a1a6c 1.73 MiB 2.32 MiB 612.47 KiB
ecf9680 1.73 MiB 2.32 MiB 612.39 KiB
4a9c176 1.73 MiB 2.33 MiB 612.69 KiB
3695453 1.73 MiB 2.32 MiB 611.62 KiB
b85d8aa 1.73 MiB 2.32 MiB 611.62 KiB

Previous results on branch: feat/start-session-on-init

Startup times

Revision Plain With Sentry Diff
6bf8ef1 347.37 ms 383.58 ms 36.21 ms
9e1b4b5 350.18 ms 389.78 ms 39.59 ms
150e4c2 342.53 ms 373.04 ms 30.51 ms
9cd1f31 306.10 ms 359.44 ms 53.34 ms
e1d07cc 376.71 ms 463.00 ms 86.29 ms
2ba762a 309.38 ms 354.92 ms 45.54 ms
60d6aed 390.47 ms 458.39 ms 67.92 ms
8d526a8 326.39 ms 368.82 ms 42.43 ms
ba8796e 334.34 ms 424.26 ms 89.91 ms

App size

Revision Plain With Sentry Diff
6bf8ef1 1.73 MiB 2.33 MiB 612.93 KiB
9e1b4b5 1.73 MiB 2.32 MiB 612.33 KiB
150e4c2 1.73 MiB 2.33 MiB 612.93 KiB
9cd1f31 1.73 MiB 2.32 MiB 610.35 KiB
e1d07cc 1.73 MiB 2.32 MiB 610.35 KiB
2ba762a 1.73 MiB 2.32 MiB 611.59 KiB
60d6aed 1.73 MiB 2.33 MiB 612.97 KiB
8d526a8 1.73 MiB 2.32 MiB 610.43 KiB
ba8796e 1.73 MiB 2.32 MiB 610.35 KiB

@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2022

Codecov Report

Base: 80.24% // Head: 80.23% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (504068c) compared to base (16371c5).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2356      +/-   ##
============================================
- Coverage     80.24%   80.23%   -0.01%     
  Complexity     3690     3690              
============================================
  Files           292      292              
  Lines         13853    13854       +1     
  Branches       1836     1836              
============================================
  Hits          11116    11116              
- Misses         2021     2022       +1     
  Partials        716      716              
Impacted Files Coverage Δ
sentry/src/main/java/io/sentry/Scope.java 96.62% <0.00%> (-0.41%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

CHANGELOG.md Outdated Show resolved Hide resolved
@markushi markushi merged commit d00c464 into main Dec 13, 2022
@markushi markushi deleted the feat/start-session-on-init branch December 13, 2022 13:07
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.

Errors shortly after SentryAndroid.init do not affect the session
3 participants