sentry-java
sentry-java copied to clipboard
Align `getSpan` method from Scope on Android/Java and iOS
related to https://github.com/getsentry/sentry-java/issues/1827 and https://github.com/getsentry/sentry-java/issues/1822
Since they have different behavior on both platforms. on iOS it always returns the root transaction. on Android/Java it returns the latest active span.
If hub is globalMode enabled, we always return the root transaction.
Doing this we don't need to do https://github.com/getsentry/sentry-java/issues/1827
This is going to break the relationship for the DB auto instrumentation, We have to create the parent span, hold the reference and create the child from it, which requires changes on the Plugin.
This is not considered a breaking change.
Next: We should talk about the thread-local storage before going forward.
Closed by #2855