← Back to Pull requests

[RUM-18763] feat(webgl)!: upgrade to Browser SDK v7 #335

Closed
unknown closed this pull request without merging on Nov 11, 2026 17:05 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 21:00 UTC
Author

What and why?

WebGL currently loads Browser SDK v6. Update the sample template to v7 with crossorigin="anonymous" and document the customer migration steps in MIGRATION.md.

Use stable resource-header capture and inherit SDK defaults for session persistence and console forwarding.

Compatibility changes

Explicitly set trackUserInteractions: false to match Flutter. Unity previously inherited v6's true default, so eligible browser clicks could generate automatic RUM actions. This intentionally stops automatic browser actions; explicitly reported Unity RUM actions continue to work.

Leave forwardConsoleLogs unset, matching Flutter. V6 implicitly forwarded console.error through forwardErrorsToLogs; v7 does not. Unity C# exceptions are still reported to RUM when enabled, but their console output is no longer also captured as Logs. Normal ForwardUnityLogs forwarding remains supported.

First-party matching fix

The WebGL bridge computed a host regex but passed the bare hostname to the Browser SDK instead. That value became an unescaped, unanchored JavaScript regex: configuring api.example.com could trace a request to https://unrelated.test/path/api.example.com/resource.

Pass the computed, escaped regex and anchor it to the HTTP(S) URL's host and configured port, including subdomains. The unrelated-origin regression case verifies that a hostname in the path does not cause tracing headers or baggage to be injected.

Tests

Split request integration coverage into four named tests using the default integration settings asset. Share view lifecycle, request completion, and resource polling helpers with the header-capture test. Validate tracing headers, resource correlation, and duplicate prevention across Android, iOS, and WebGL.

Validation:

  • Unity unit tests: 360 passed (47 EditMode, 313 PlayMode).

  • Regex follow-up: 21 JavaScript matching checks passed, including nested subdomains, configured ports, unrelated origins, and the reported long-host backtracking case; all 5 WebGL request/header tests passed.

  • Python: 247 passed; ruff and ty passed.

  • WebGL: 28 passed, 3 expected skips; default-settings request check passed.

  • iOS Simulator: 31 passed using the completed export after an Editor shutdown crash. Restaged the repository's pinned SDK 3.21.0 before building.

  • Android: 30 passed; the unchanged RUM duration test passed its isolated rerun after an intermittent timing failure.

  • Result bridge: 3 focused checks passed after removing the configuration assertion.

  • After the test refactor: all 5 request/header cases passed in WebGL; Android and iOS each passed the 3 shared cases and skipped the 2 browser-only cases.
  • Review checklist

  • This pull request has appropriate unit and / or integration tests
  • Diff: 353 lines (+264 / -89) across 4 files Reviewer: barboraplasovska Review duration: 2644m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 353 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #335"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.5% (MEDIUM) · Higher = larger blast radius
    42.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.8% · Safe to merge
    16.8%