Skip to content

perf(core): Avoid repeated sensitive denylist normalization - #6704

Merged
0xadam-brown merged 3 commits into
mainfrom
0xadam-brown/perf/avoid-repeated-denylist-normalization-standalone
Nov 20, 2026
Merged

0xadam-brown merged 3 commits into
mainfrom
0xadam-brown/perf/avoid-repeated-denylist-normalization-standalone

Conversation

@0xadam-brown

@0xadam-brown 0xadam-brown commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

A bug I found while doing some tangentially-related Nav3 work.

📜 Description

PR eliminates redundant work when filtering sensitive data from HTTP headers, query parameters, and cookies.

Previously, we'd repeatedly scan already-lowercase denylist terms to try to (pointlessly) lowercase them again, and we'd do so for every query parameter or header name we checked. Now we don't.

SDK behavior is unchanged.

💡 Motivation and Context

Sensitive-data filtering runs repeatedly as the SDK collects request data. Lowercasing the same fixed denylist terms for every name adds unnecessary work; using their known lowercase form removes that repetition without changing which values are filtered. Built-in sensitive keys continue to take precedence over allowlists, and matching remains independent of the device's default locale.

💚 How did you test it?

  • Unit tests (existing and new).

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

#skip-changelog

Match built-in sensitive terms in their existing lowercase form and normalize
only the input key. Reuse this path for query parameters and headers while
preserving case-insensitive matching for caller-configured terms.

Cover mixed-case matching, sensitive allowlist precedence, empty terms, and
locale independence.

Co-Authored-By: Codex <noreply@openai.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 3f4c49a.

Main concerns: reach, data sent to Sentry, host performance.

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.0 (1) release

⚙️ sentry-android Build Distribution Settings

Preserve the original filtering examples and add dedicated casing tests
for query parameters and headers in allowlist and denylist modes.

Co-Authored-By: Codex <noreply@openai.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 20, 2026
Describe the added cases using the behavior-based naming already used
in HttpUtilsTest.

Co-Authored-By: Codex <noreply@openai.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 20, 2026
@0xadam-brown 0xadam-brown added the sanity-check PR needs a lightweight review for obvious issues label Nov 20, 2026
@0xadam-brown
0xadam-brown marked this pull request as ready for review November 20, 2026 12:08
@0xadam-brown
0xadam-brown requested review from a team and adinauer as code owners November 20, 2026 12:08
@0xadam-brown
0xadam-brown requested review from markushi and runningcode and removed request for a team November 20, 2026 12:08
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 20, 2026
@0xadam-brown
0xadam-brown merged commit 9c26cdd into main Nov 20, 2026
60 checks passed
@0xadam-brown
0xadam-brown deleted the 0xadam-brown/perf/avoid-repeated-denylist-normalization-standalone branch November 20, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants