Repository navigation
Conversation
Contributor
PR risk: mediumFor commit Main concerns: reach, public contract, host performance. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
Contributor
|
Thanks. Please take a look at our CONTRIBUTING.md and make sure to discuss before opening a PR https://github.com/getsentry/sentry-java/blob/main/CONTRIBUTING.md#submitting-changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
When the app comes to the foreground and no background window is pending,
LifecycleWatcherdecided whether the session SDK init started is stale by comparingSession.getStarted()with the wall clock. A clock step between init and the first foreground could start an extra session or keep a stale one.A session started by
Scope.startSession()now keeps aStopwatchon the options' monotonic ticker. It's in memory only and is never serialized (the clone carries it).LifecycleWatcherchecks its elapsed time against the session interval, so it no longer needs theEpochClock. A session without one is treated as stale, same as no session.💡 Motivation and Context
Fixes #6663
Follow-up to #6096, removes the
TODO [MAJOR]inisSessionOnScopeStale().💚 How did you test it?
Unit tests in
LifecycleWatcherTestdrive the session's stopwatch withTestMonotonicTickerand set its wall-clock start an hour ahead or behind. Also added aScopeTestcase for the stopwatch being set.📝 Checklist
sendDefaultPIIis enabled.Sessiongets an@ApiStatus.Internalgetter/setter for the stopwatch.🔮 Next steps