-
-
Notifications
You must be signed in to change notification settings - Fork 226
startSession and endSession available thru the Static class #248
Comments
On Cocoa, you have both I think it would make sense to offer both |
I wish that wasn't public. We have as part of the documented API a way to bind a client to the scope. but swapping out Hubs from the static API isn't something users should be aware as I understand there are no use cases and just makes things harder for us to reason about the code base.
Makes sense to me. The static |
I think the main reason why this is public in Cocoa is that RN, for example, uses it. Still, we could replace the usages in RN with calls to a new method in SentrySDK directly. I propose the following:
|
Sound good to me. @HazAT you might have thoughts or we're good to go? |
@mitsuhiko any reasons not to add |
I don’t have strong opinions. It didn’t sound like a super common use case which is why it was on the hub to start. |
This is quite similar in spirit to the I wonder if instead of documenting |
@rhcarvalho pretty much because |
I agree with @marandaneto that we shouldn't expose |
@lbloder FYI |
This was fixed with getsentry/sentry-cocoa#1021 in 2021. We can close this. |
Java does have
Sentry.startSession
andSentry.endSession
so if one decides to do its own instrumentation, that's possible.https://develop.sentry.dev/sdk/sessions/#exposed-api
here the exposed API only states available thru the
Hub
.Java hides
getCurrentHub
, it's package-private.Cocoa has
SentrySDK.currentHub()
public so one couldSentrySDK.currentHub().startSession()
but it doesn't haveSentrySDK.startSession
directly on the Static API.Is there a reason why? should we unify this?
@bruno-garcia @philipphofmann
tagging @mitsuhiko as the initial API design.
The text was updated successfully, but these errors were encountered: