We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Platform:
IDE:
Build system:
Android Gradle Plugin:
Sentry Android Gradle Plugin:
Proguard/R8:
Platform installed with:
The version of the SDK: 5.2.1
When clonnig Sentry.getCurrentHub() and setting it to the current hub in the new thread scope.contexts is not copied and always empty.
Sentry.getCurrentHub()
scope.contexts
Example code:
private @NotNull Runnable copyContext(@NotNull Runnable runnable) { final IHub oldState = Sentry.getCurrentHub(); final IHub newHub = Sentry.getCurrentHub().clone(); return () -> { try { Sentry.setCurrentHub(newHub); runnable.run(); } finally { Sentry.setCurrentHub(oldState); } }; }
Root cause: Looks like this is because of the issue in the copy constructor of the Scope class.
Scope
sentry-java/sentry/src/main/java/io/sentry/Scope.java
Line 133 in ff74a9e
this.contexts and contexts are actually exactly the same this instance
this.contexts
contexts
this
Expected result:
The text was updated successfully, but these errors were encountered:
@dmitrybabeshko thanks for raising, good catch, looks like it should be:
this.contexts = new Contexts(scope.contexts); instead.
this.contexts = new Contexts(scope.contexts);
@maciejwalkowiak mind having a look?
Sorry, something went wrong.
Fixed in #1763
No branches or pull requests
Platform:
IDE:
Build system:
Android Gradle Plugin:
Sentry Android Gradle Plugin:
Proguard/R8:
Platform installed with:
The version of the SDK:
5.2.1
When clonnig
Sentry.getCurrentHub()
and setting it to the current hub in the new threadscope.contexts
is not copied and always empty.Example code:
Root cause:
Looks like this is because of the issue in the copy constructor of the
Scope
class.sentry-java/sentry/src/main/java/io/sentry/Scope.java
Line 133 in ff74a9e
this.contexts
andcontexts
are actually exactly the samethis
instanceExpected result:
scope.contexts
is copied to the new hub while cloningThe text was updated successfully, but these errors were encountered: