Repository navigation
fix(protocol): Allow Contexts.setProfile(null) to clear the profile context - #6684
Merged
Merged
Conversation
…ontext setProfile takes a @nullable ProfileContext but threw on null. Drop the requireNonNull so a null argument removes the profile context, the same as Contexts.put does for any other key. Fixes JAVA-705 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR risk: mediumFor commit Main concerns: reach, public contract, data sent to Sentry. This label is a hint for reviewers, not an approval. |
runningcode
marked this pull request as ready for review
November 19, 2026 15:52
runningcode
requested review from
0xadam-brown and
markushi
and removed request for
a team
November 19, 2026 15:52
markushi
approved these changes
Nov 19, 2026
📲 Install BuildsAndroid
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📜 Description
Contexts.setProfiletakes a@Nullable ProfileContextbut calledObjects.requireNonNullon it, so passingnullthrew. This drops the check:setProfile(null)now removes the profile context, the same wayContexts.puttreats anullvalue for any other key.💡 Motivation and Context
The annotation and the runtime check disagreed. The profile context is only present while a continuous profile runs, so
@Nullableis the intended contract.💚 How did you test it?
Added a
ContextsTestcase that sets a profile context, then setsnull, and checks it is gone.📝 Checklist
sendDefaultPIIis enabled.🤖 Generated with Claude Code