diff --git a/Sources/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandler.swift b/Sources/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandler.swift index a5f804d4e5..5b84dc9ce8 100644 --- a/Sources/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandler.swift +++ b/Sources/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandler.swift @@ -42,7 +42,6 @@ internal class URLSessionRUMResourcesHandler: URLSessionInterceptionHandler, RUM url: url, httpMethod: RUMMethod(httpMethod: interception.request.httpMethod), kind: RUMResourceType(request: interception.request), - isFirstPartyRequest: interception.isFirstPartyRequest, spanContext: interception.spanContext.flatMap { spanContext in .init( traceID: String(spanContext.traceID.rawValue), diff --git a/Sources/Datadog/RUM/RUMMonitor/RUMCommand.swift b/Sources/Datadog/RUM/RUMMonitor/RUMCommand.swift index 2b7072090b..2f7d6e52b8 100644 --- a/Sources/Datadog/RUM/RUMMonitor/RUMCommand.swift +++ b/Sources/Datadog/RUM/RUMMonitor/RUMCommand.swift @@ -157,8 +157,6 @@ internal struct RUMStartResourceCommand: RUMResourceCommand { let httpMethod: RUMMethod /// A type of the Resource if it's possible to determine on start (when the response MIME is not yet known). let kind: RUMResourceType? - /// Whether or not the resource url targets a first party host, if that information is available. - let isFirstPartyRequest: Bool? /// Span context passed to the RUM backend in order to generate the APM span for underlying resource. let spanContext: RUMSpanContext? } diff --git a/Sources/Datadog/RUM/RUMMonitor/Scopes/RUMViewScope.swift b/Sources/Datadog/RUM/RUMMonitor/Scopes/RUMViewScope.swift index bc12080c7a..9005d2a7d9 100644 --- a/Sources/Datadog/RUM/RUMMonitor/Scopes/RUMViewScope.swift +++ b/Sources/Datadog/RUM/RUMMonitor/Scopes/RUMViewScope.swift @@ -234,7 +234,7 @@ internal class RUMViewScope: RUMScope, RUMContextProvider { dateCorrection: dateCorrection, url: command.url, httpMethod: command.httpMethod, - isFirstPartyResource: command.isFirstPartyRequest, + isFirstPartyResource: dependencies.firstPartyURLsFilter.isFirstParty(string: command.url), resourceKindBasedOnRequest: command.kind, spanContext: command.spanContext, onResourceEventSent: { [weak self] in diff --git a/Sources/Datadog/RUMMonitor.swift b/Sources/Datadog/RUMMonitor.swift index c396dca039..1d9d6ca8f3 100644 --- a/Sources/Datadog/RUMMonitor.swift +++ b/Sources/Datadog/RUMMonitor.swift @@ -349,7 +349,6 @@ public class RUMMonitor: DDRUMMonitor, RUMCommandSubscriber { url: request.url?.absoluteString ?? "unknown_url", httpMethod: RUMMethod(httpMethod: request.httpMethod), kind: RUMResourceType(request: request), - isFirstPartyRequest: applicationScope.dependencies.firstPartyURLsFilter.isFirstParty(url: request.url), spanContext: nil ) ) @@ -368,7 +367,6 @@ public class RUMMonitor: DDRUMMonitor, RUMCommandSubscriber { url: url.absoluteString, httpMethod: .get, kind: nil, - isFirstPartyRequest: applicationScope.dependencies.firstPartyURLsFilter.isFirstParty(url: url), spanContext: nil ) ) @@ -388,7 +386,6 @@ public class RUMMonitor: DDRUMMonitor, RUMCommandSubscriber { url: urlString, httpMethod: httpMethod, kind: nil, - isFirstPartyRequest: applicationScope.dependencies.firstPartyURLsFilter.isFirstParty(string: urlString), spanContext: nil ) ) diff --git a/Tests/DatadogTests/Datadog/Mocks/RUMFeatureMocks.swift b/Tests/DatadogTests/Datadog/Mocks/RUMFeatureMocks.swift index becb99c0f4..80e196cdaa 100644 --- a/Tests/DatadogTests/Datadog/Mocks/RUMFeatureMocks.swift +++ b/Tests/DatadogTests/Datadog/Mocks/RUMFeatureMocks.swift @@ -362,7 +362,6 @@ extension RUMStartResourceCommand: AnyMockable, RandomMockable { url: url, httpMethod: httpMethod, kind: kind, - isFirstPartyRequest: isFirstPartyRequest, spanContext: spanContext ) } diff --git a/Tests/DatadogTests/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandlerTests.swift b/Tests/DatadogTests/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandlerTests.swift index 99360106a0..840e4ae03f 100644 --- a/Tests/DatadogTests/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandlerTests.swift +++ b/Tests/DatadogTests/Datadog/RUM/Instrumentation/Resources/URLSessionRUMResourcesHandlerTests.swift @@ -45,39 +45,7 @@ class URLSessionRUMResourcesHandlerTests: XCTestCase { XCTAssertNil(resourceStartCommand.spanContext) } - func testGivenTaskInterceptionForFirstPartyHost_whenInterceptionStarts_itStartsRUMResourceForFirstPartyHost() throws { - let receiveCommand = expectation(description: "Receive RUM command") - commandSubscriber.onCommandReceived = { _ in receiveCommand.fulfill() } - - // Given - let taskInterception = TaskInterception(request: .mockAny(), isFirstParty: true) - - // When - handler.notify_taskInterceptionStarted(interception: taskInterception) - - // Then - waitForExpectations(timeout: 0.5, handler: nil) - - let resourceStartCommand = try XCTUnwrap(commandSubscriber.lastReceivedCommand as? RUMStartResourceCommand) - XCTAssertTrue(resourceStartCommand.isFirstPartyRequest!) - } - - func testGivenTaskInterceptionForThirdPartyHost_whenInterceptionStarts_itStartsRUMResourceForThirdPartyHost() throws { - let receiveCommand = expectation(description: "Receive RUM command") - commandSubscriber.onCommandReceived = { _ in receiveCommand.fulfill() } - - // Given - let taskInterception = TaskInterception(request: .mockAny(), isFirstParty: false) - - // When - handler.notify_taskInterceptionStarted(interception: taskInterception) - - // Then - waitForExpectations(timeout: 0.5, handler: nil) - - let resourceStartCommand = try XCTUnwrap(commandSubscriber.lastReceivedCommand as? RUMStartResourceCommand) - XCTAssertFalse(resourceStartCommand.isFirstPartyRequest!) - } + func testGivenTaskInterceptionWithSpanContext_whenInterceptionStarts_itStartsRUMResource() throws { let receiveCommand = expectation(description: "Receive RUM command")