Repository navigation
Conversation
The WebView demo page loaded @sentry/browser from the CDN with a blocking script in <head>. Until the CDN responded, the page's own script that reads the injected sentry-trace meta tag and posts it back to React Native could not run. On CI emulators with a slow network this outlasted the E2E wait, so the trace status stayed "not connected" and the test failed. Load the CDN script with async and call Sentry.init from its onload. Refs #7093 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
📲 Install BuildsAndroid
|
antonis
marked this pull request as ready for review
November 24, 2026 15:24
antonis
marked this pull request as draft
November 24, 2026 15:35
antonis
commented
Nov 24, 2026
antonis
left a comment
Contributor
Author
There was a problem hiding this comment.
Converting back to draft since the check remains flaky
The WebView trace test only reported that the "connected" status never appeared. Print the texts on screen, including the WebView page's own text, so a CI failure shows whether the page never saw the injected meta tag, the page script never ran, or the readback did not reach React Native. Refs #7093 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
📢 Type of change
📜 Description
The sample's WebView demo page (
WebviewScreen.tsx) loaded@sentry/browserfrom the CDN with a blocking<script>in<head>. Until the CDN responded, the HTML parser could not reach the page's own<body>script. That script reads the injectedsentry-tracemeta tag and posts it back to React Native. The CDN script now loads withasync, andSentry.initruns from itsonload.Only the sample app changes, not the SDK.
💡 Motivation and Context
Fixes #7093, together with #7097.
webViewTraceConnection.test.tswas the most frequent Android failure insample-application.yml: 7 of 15 first-attempt Android failures, all withAssertion is false: "WebView trace connected.*", id: webview-trace-status is visibleafter the 30 s wait. The test did not fail locally under normal conditions. A slow or stalled CDN request on the CI emulator fully explains it.💚 How did you test it?
On an emulator matching CI (API 30
aosp_atd,-gpu swiftshader_indirect), with outbound HTTPS dropped (iptables -I OUTPUT -p tcp --dport 443 -j DROP) so the CDN request hangs:main: the test fails with the CI signature after 37 s, and the screen shows "WebView received: (waiting…)".The e2e DSN is plain HTTP while the page is served over HTTPS, so on device the browser SDK's own events are blocked as mixed content, with or without this change. To check that
Sentry.initstill runs, I loaded the same page logic in headless Chrome:Sentry.initranasync+onload)<head>📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
webViewTraceConnectiononmainafter merge, together with the test(e2e): Fix flaky sample app E2E tests #7097 fixes.injectedJavaScriptBeforeContentLoadedfromonPageStarted. If that runs againstabout:blank, our injection returns early because the hostname is empty. This is a possible SDK gap insentryWebViewProps, not needed to explain this flake.🤖 Generated with Claude Code