fix: Ensure user.ip_address defaults to auto with send_default_pii on#392
Merged
fix: Ensure user.ip_address defaults to auto with send_default_pii on#392
user.ip_address defaults to auto with send_default_pii on#392Conversation
Collaborator
|
Instead of inferring the IP address at startup, would it help to conditionally fill it in at the time of capturing events? |
Collaborator
Author
|
That would mean we have to expose the user interface on the event object for each platform, so we could manipulate it inside a processor, which is way more involved. I'm not sure if it's the right way to do it either. If a dev sets a user without IP inference, do they want IP not inferred or did they forget to do it? Is it our job to guess based solely on @bruno-garcia wdyt? |
vaind
approved these changes
Sep 29, 2025
Contributor
vaind
left a comment
There was a problem hiding this comment.
LGTM as is. I don't think there's any benefit delaying setting the user in the event handler.
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.
This PR ensures that
ip_addressis set to{{auto}}whensend_default_piiis enabled, and removesget_user()from API since it is unavailable in Native and Android, and probably not needed, and its previous caching-based implementation was prone to stale data issues.Note
Auto-creates a default user (with ip_address={{auto}} when send_default_pii is enabled), removes SentrySDK.get_user(), and updates SDK init flow/signatures accordingly.
SentrySDK.get_user()from API and docs.InternalSDK.init(...)signature to drop theSentryUserparameter; update Android/Cocoa/Native/Disabled implementations.SentryUser.create_default()to generate installation-basedidand setip_addressto{{auto}}whensend_default_piiis true.SentrySDKand related mutex usage.doc_classes/SentrySDK.xml(removeget_user) anddoc_classes/SentryUser.xml(documentcreate_default).CHANGELOG.mdwith breaking change and behavior note.user.ip_addresspresence/absence.get_user(), validate property behaviors, default user persistence, and ID generation.Written by Cursor Bugbot for commit f211a42. This will update automatically on new commits. Configure here.