Skip to content
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

Contexts.setTrace can't be null #3414

Closed
leonchen83 opened this issue May 13, 2024 · 5 comments
Closed

Contexts.setTrace can't be null #3414

leonchen83 opened this issue May 13, 2024 · 5 comments
Assignees
Labels
Platform: Java Type: Bug Something isn't working
Milestone

Comments

@leonchen83
Copy link

Integration

sentry-android

Build System

Gradle

AGP Version

7.4.2

Proguard

Enabled

Version

7.8.0

Steps to Reproduce

Contexts.setTrace(final @nullable SpanContext traceContext)

Expected Result

it's Nullable. so traceContext can set to null.

Actual Result

throw NPE.
We want set this value to null as same as iOS sdk.

@adinauer
Copy link
Member

Thanks for opening this issue @leonchen83. We'll change this to actually allow setting null.

@adinauer
Copy link
Member

I've just taken a more detailed look at this and we do actually want a trace context to be there. Transactions are even dropped, if trace context is missing. I'll send a PR to update the annotation(s) but we'll keep requiring trace.

@leonchen83
Copy link
Author

Hi
but this behavior is not consistent with the iOS SDK, and we do not need to set the context trace

@adinauer
Copy link
Member

Thanks, I'll clarify about consistency, but for now I'll move forward with the @NotNull since that reflects what the current implementation does.

@adinauer
Copy link
Member

adinauer commented Oct 9, 2024

We just had a talk about this and want to keep trace context required, i.e. @NotNull.

@adinauer adinauer closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Java Type: Bug Something isn't working
Projects
Archived in project
Archived in project
Development

No branches or pull requests

3 participants