Skip to content

fix(core): [Data Collection 23] Support WebSocket URL parsing - #6064

Draft
adinauer wants to merge 4 commits into
feat/data-collection-android-manifestfrom
fix/data-collection-websocket-urls
Draft

fix(core): [Data Collection 23] Support WebSocket URL parsing#6064
adinauer wants to merge 4 commits into
feat/data-collection-android-manifestfrom
fix/data-collection-websocket-urls

Conversation

@adinauer

@adinauer adinauer commented Sep 7, 2026

Copy link
Copy Markdown
Member

PR Stack (Data Collection)


📜 Description

Allow UrlUtils to parse structurally valid ws and wss URIs without requiring a JVM URLStreamHandler. Keep the existing handler-based validation for every other scheme to preserve support for built-in and customer-installed handlers.

💡 Motivation and Context

Java WebSocket clients consume URI directly and generally do not install global URL handlers. Converting a valid WebSocket URI with URI.toURL() therefore commonly fails, causing Ktor WebSocket span descriptions and request URLs to fall back to unknown values.

Refs #5666

💚 How did you test it?

  • ./gradlew :sentry:test --tests='io.sentry.util.UrlUtilsTest' --rerun-tasks --no-parallel --no-configuration-cache --max-workers=1
  • ./gradlew spotlessApply apiDump --no-parallel --no-configuration-cache --max-workers=1
  • git diff --check

📝 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

None.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

Treat ws and wss as valid hierarchical URIs without requiring JVM URL handlers. This preserves Ktor WebSocket span descriptions and query filtering instead of falling back to an unknown URL.

Refs #5666
Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Sep 7, 2026
adinauer and others added 2 commits September 7, 2026 11:16
Propagate the corrected OkHttp Set-Cookie fixture through the Data Collection PR stack.

Co-Authored-By: Claude <noreply@anthropic.com>
@sentry

sentry Bot commented Sep 7, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

Propagate the OpenTelemetry span-description revert from the preceding stack branch.

Co-Authored-By: Claude <noreply@anthropic.com>
@adinauer adinauer changed the title fix(core): [Data Collection 24] Support WebSocket URL parsing fix(core): [Data Collection 23] Support WebSocket URL parsing Sep 7, 2026

@lbloder lbloder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants