fix(browser): Ensure IP address is only inferred by Relay if sendDefaultPii is true#17364
Merged
fix(browser): Ensure IP address is only inferred by Relay if sendDefaultPii is true#17364
sendDefaultPii is true#17364Conversation
…aultPii` is `true`
Contributor
size-limit report 📦
|
Lms24
commented
Aug 8, 2025
Lms24
commented
Aug 8, 2025
mydea
reviewed
Aug 11, 2025
| export { parameterize, fmt } from './utils/parameterize'; | ||
| export { addAutoIpAddressToSession, addAutoIpAddressToUser } from './utils/ipAddress'; | ||
|
|
||
| export { addAutoIpAddressToSession } from './utils/ipAddress'; |
Member
There was a problem hiding this comment.
do we leave this on purpose iun-deprecated - is this still needed?
Member
Author
mydea
approved these changes
Aug 11, 2025
mydea
reviewed
Aug 11, 2025
| 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! |
This was referenced Aug 11, 2025
Lms24
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Aug 12, 2025
…tion guide (#14609) Mentions a fix to be introduced in [10.4.0](getsentry/sentry-javascript#17364) in the migration guide given it has quite a lot of impact, albeit belated (should have been like this since v9). This change is now mentioned in: - 10.4.0 changelog - in-repo migration guide - in-docs migration guide (this PR)
This was referenced Aug 20, 2025
10 tasks
10 tasks
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 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_addresswas 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