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.
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
Feat: Perf. for fragments #1528
Feat: Perf. for fragments #1528
Changes from 30 commits
3ce3661
2ca9823
1c7e065
add0350
bd7f30d
79bd7b9
5705d0e
b658cdc
0962c4f
2e4ad56
705b3de
0ccbf03
7c0d868
eb2c03c
340343f
6c70853
4133da5
e72175a
c95b0e5
12102a0
687d67b
a9d6fe9
e61b20f
ad9abc1
60cb1c5
ebae3ab
32cca7e
156c1e6
6b7429a
2db51a4
ace275c
7e062b7
c064ab7
bef4872
d745940
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use the accessor like I suggested above, it would affect this too given the new hub could have perf enabled but the first not. So technically we'd need to evaluate this on each call
hubAcessor().options....
Unless we get a new instance of this class for each Hub (each
Sentry.init
) in which case it would be fine we bind to the on Hub and disable when the hub closes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @bruno-garcia. I think this would to the trick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its a new instance per activity, as the callback is bound to the fragment manager, and each activity has its own fragmentmanager, I guess its the same as #1528 (comment)
so in the case that a new activity is setup and
isTracingEnabled
is disabled, nothing is gonna happen.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h
: IfisPerformanceEnabled
is evaluated on each call it could be that it is disabled here and never finish the span. IfisPerformanceEnabled
is set tofalse
and we have a running span we could just discard the span.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cannot mutate the
isPerformanceEnabled
after the SDK is inited, so I don't see the point of taking care of this corner case, the same happens onActivityLifecycleIntegration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you do some crazy stuff like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could, yes, this would be misusing the API hence not really a case that we should take care, if we take this option in consideration, there are N cases that would break the whole SDK, or using reflection and setting non null fields to null etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also
init
should be called only once, its part of the spec.