You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SentryAndroidOptions to enable NetworkDetails extraction (#4900)
* Add network details to SentryReplayOptions API
./gradlew apiDump
* Extract NetworkDetails options from manifest
* Hook SentryOkHttpInterceptor into SentryReplayOptions
* Merge requested headers with default headers on write instead of on read
More efficient -> getNetworkRequestHeaders/getNetworkResponseHeaders is invoked on every http request but setNetwork... is only invoked on start-up
* Initialize RRWebOptionsEvent#networkDetailHasUrls based on SentryReplayOptions
networkDetailHasUrls is a gate that the front-end uses to determine whether there is data to show the end-user
https://github.com/getsentry/sentry-javascript/blob/090a3e35a94014aad4dfd06a6ff3c361f0420009/packages/replay-internal/src/util/handleRecordingEmit.ts#L134
* Remove defensive copy when returning request|responseHeaders
getNetworkRequestHeaders / getNetworkResponseHeaders are called on every http request => move the memory operation to the setNetworkRequest|ResponseHeaders path which is called 1x on start-up
* Add the network details options as 'tags' on the replay
* Add network details flags in manifest for sentry-samples test app
---------
Co-authored-by: Sentry Github Bot <[email protected]>
Copy file name to clipboardExpand all lines: sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt
+246Lines changed: 246 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1882,4 +1882,250 @@ class ManifestMetadataReaderTest {
1882
1882
fixture.options.sessionReplay.screenshotStrategy,
1883
1883
)
1884
1884
}
1885
+
1886
+
// Network Detail Configuration Tests
1887
+
1888
+
@Test
1889
+
fun`applyMetadata reads comma-separated networkDetailAllowUrls from manifest`() {
1890
+
// Arrange
1891
+
val expectedUrls ="https://api.example.com/.*,https://cdn.example.com/.*"
1892
+
val bundle = bundleOf(ManifestMetadataReader.REPLAYS_NETWORK_DETAIL_ALLOW_URLS to expectedUrls)
1893
+
val context = fixture.getContext(metaData = bundle)
fun`applyMetadata reads comma-separated networkDetailDenyUrls from manifest`() {
1919
+
// Arrange
1920
+
val expectedUrls ="https://private.example.com/.*,https://internal.example.com/.*"
1921
+
val bundle = bundleOf(ManifestMetadataReader.REPLAYS_NETWORK_DETAIL_DENY_URLS to expectedUrls)
1922
+
val context = fixture.getContext(metaData = bundle)
0 commit comments