-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
Send user.ip_address = {{auto}} when sendDefaultPii is true #1144
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1144 +/- ##
============================================
+ Coverage 75.16% 75.23% +0.07%
- Complexity 1620 1627 +7
============================================
Files 167 167
Lines 5624 5637 +13
Branches 549 555 +6
============================================
+ Hits 4227 4241 +14
+ Misses 1146 1144 -2
- Partials 251 252 +1
Continue to review full report at Codecov.
|
user.setIpAddress(DEFAULT_IP_ADDRESS); | ||
event.setUser(user); | ||
} else if (event.getUser().getIpAddress() == null) { | ||
event.getUser().setIpAddress(DEFAULT_IP_ADDRESS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to undo this in the spring
integration, since {{auto}}
there will give the IP of the server.
Like check for default and set null instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In such case wouldn't it be better if we make it an opt in which is pre-configured in Android? Undoing it in Spring looks for me like a workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maciejwalkowiak That means desktop apps would have to opt-in too.
I think it's fair to say: It's enabled by default but you can opt-out. And we know better in some integrations to opt out already.
We need to document this behavior. Similar to how the default of another option is documented here:
getsentry/sentry-docs#2815
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we check for {{auto}}
and set it to null if isSendDefaultPii
is disabled would be a breaking change btw which is fine as 4.0 is a major bump, but yeah we'd need to document.
Also, it could be written {{ auto }}
with spaces, so we'd need to trim spaces off if we want to compare that properly as well, otherwise, it'd not be a match and IPs will be set by the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is breaking the Android user, see:
now the user
will never be null (if isSendDefaultPii enabled), we need to fix the if
condition in the DefaultAndroidEventProcessor
class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undoing in Spring integration ✅
Updating Android code ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has been merged but there's a bug here.
{{ auto }}
is valid
{{auto}}
is also valid
previously {{auto}}
was not valid and its been fixed on the backend, so people were setting {{ auto }}
manually, those people, it won't work as the comparison is not trimming off the spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Will be fixed in next PR.
📜 Description
Send user.ip_address = {{ auto }} when sendDefaultPii is true
💡 Motivation and Context
Fixes #1015
💚 How did you test it?
Unit tests.
📝 Checklist