-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(browser): Ensure IP address is only inferred by Relay if sendDefaultPii
is true
#17364
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
Conversation
…aultPii` is `true`
size-limit report 📦
|
@@ -63,7 +63,10 @@ export { hasSpansEnabled } from './utils/hasSpansEnabled'; | |||
export { isSentryRequestUrl } from './utils/isSentryRequestUrl'; | |||
export { handleCallbackErrors } from './utils/handleCallbackErrors'; | |||
export { parameterize, fmt } from './utils/parameterize'; | |||
export { addAutoIpAddressToSession, addAutoIpAddressToUser } from './utils/ipAddress'; | |||
|
|||
export { addAutoIpAddressToSession } from './utils/ipAddress'; |
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.
do we leave this on purpose iun-deprecated - is this still needed?
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.
However, after updating the SDK, events (errors, traces, replays, etc.) sent from the browser, will only include | ||
user IP addresses, if you set `sendDefaultPii: true` in your `Sentry.init` options. | ||
|
||
We apologize for any inconvenience caused! |
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.
great changelog message ❤️
This PR fixes a long-standing problem in the SDK where it would set incorrect information about when Relay should (not) infer IP addresses from sent envelope requests.
Previously, this was thought to be controlled by setting
event.user.ip_address: '{{auto}}'
. However, after an incident in Relay, it was determined that this is in fact not a reliably way to control IP inference. Instead, SDKs should setevent.sdk.settings.infer_ip: 'auto' | 'never'
(see closes #16252).Unfortunately, this wasn't implemented immediately but is taken care of in this PR.
(FWIW, the only reason why Relay continued to infer IP addresses for the JS SDK was because it is excempt from logic that would infer IP addresses only if
user.ip_address
was set to'{{auto}}'
. This is necessary to backwards compatibility with older SDKs.)Follow-ups: We likely also need to adjust the logic in Electron and Lynx (at the very least remove setting
user.ip_address
).closes #17351
closes #16252