Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased

- [IMPROVEMENT] Increase RUM batch maximum age to 24hrs. See [#2302][]
- [IMPROVEMENT] Improve feature-to-feature communication performances. See [#2304][]

# 2.27.0 / 06-05-2025

Expand Down Expand Up @@ -875,6 +876,7 @@ Release `2.0` introduces breaking changes. Follow the [Migration Guide](MIGRATIO
[#2260]: https://github.com/DataDog/dd-sdk-ios/pull/2260
[#2268]: https://github.com/DataDog/dd-sdk-ios/pull/2268
[#2302]: https://github.com/DataDog/dd-sdk-ios/pull/2302
[#2304]: https://github.com/DataDog/dd-sdk-ios/pull/2304
[@00fa9a]: https://github.com/00FA9A
[@britton-earnin]: https://github.com/Britton-Earnin
[@hengyu]: https://github.com/Hengyu
Expand Down
42 changes: 0 additions & 42 deletions Datadog/Datadog.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions DatadogCore/Sources/Core/DatadogCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,6 @@ extension DatadogCore: DatadogCoreProtocol {
return CoreFeatureScope<Feature>(in: self)
}

func set(baggage: @escaping () -> FeatureBaggage?, forKey key: String) {
contextProvider.write { $0.baggages[key] = baggage() }
}

func set<Context>(context: @escaping () -> Context?) where Context: AdditionalContext {
contextProvider.write { $0.set(additionalContext: context()) }
}
Expand Down Expand Up @@ -382,10 +378,6 @@ internal class CoreFeatureScope<Feature>: @unchecked Sendable, FeatureScope wher
core?.send(message: message, else: fallback)
}

func set(baggage: @escaping () -> FeatureBaggage?, forKey key: String) {
core?.set(baggage: baggage, forKey: key)
}

func set<Context>(context: @escaping () -> Context?) where Context: AdditionalContext {
core?.set(context: context)
}
Expand Down Expand Up @@ -496,7 +488,6 @@ extension DatadogCore: Flushable {
// follow our design choices around SDK core's threading.

// Reset baggages that need not be persisted across flushes.
set(baggage: nil, forKey: LaunchReport.key)
removeContext(ofType: LaunchReport.self)

let features = features.values.compactMap { $0 as? Flushable }
Expand Down
18 changes: 11 additions & 7 deletions DatadogCore/Tests/Datadog/DatadogCore/DatadogCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class DatadogCoreTests: XCTestCase {
XCTAssertEqual(requestBuilderSpy.requestParameters.count, 1, "It should send only one request")
}

func testWhenFeatureBaggageIsUpdated_thenNewValueIsImmediatellyAvailable() throws {
func testWhenFeatureAdditionalContextIsUpdated_thenNewValueIsImmediatellyAvailable() throws {
// Given
let core = DatadogCore(
directory: temporaryCoreDirectory,
Expand All @@ -212,29 +212,33 @@ class DatadogCoreTests: XCTestCase {
let scope = core.scope(for: FeatureMock.self)

// When
struct ContextMock: AdditionalContext {
static let key = "key"
let value: String
}
let key = "key"
let expectation1 = self.expectation(description: "retrieve context")
let expectation2 = self.expectation(description: "retrieve context and event writer")
expectation1.expectedFulfillmentCount = 2
expectation2.expectedFulfillmentCount = 2

core.set(baggage: "baggage 1", forKey: key)
core.set(context: ContextMock(value: "value 1"))
scope.context { context in
XCTAssertEqual(try! context.baggages[key]!.decode(type: String.self), "baggage 1")
XCTAssertEqual(context.additionalContext(ofType: ContextMock.self)?.value, "value 1")
expectation1.fulfill()
}
scope.eventWriteContext { context, _ in
XCTAssertEqual(try! context.baggages[key]!.decode(type: String.self), "baggage 1")
XCTAssertEqual(context.additionalContext(ofType: ContextMock.self)?.value, "value 1")
expectation2.fulfill()
}

core.set(baggage: "baggage 2", forKey: key)
core.set(context: ContextMock(value: "value 1"))
scope.context { context in
XCTAssertEqual(try! context.baggages[key]!.decode(type: String.self), "baggage 2")
XCTAssertEqual(context.additionalContext(ofType: ContextMock.self)?.value, "value 1")
expectation1.fulfill()
}
scope.eventWriteContext { context, _ in
XCTAssertEqual(try! context.baggages[key]!.decode(type: String.self), "baggage 2")
XCTAssertEqual(context.additionalContext(ofType: ContextMock.self)?.value, "value 1")
expectation2.fulfill()
}

Expand Down
17 changes: 7 additions & 10 deletions DatadogCore/Tests/Datadog/RUM/TelemetryReceiverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@ class TelemetryReceiverTests: XCTestCase {
{ core.telemetry.debug(id: .mockRandom(), message: "telemetry debug") },
{ core.telemetry.error(id: .mockRandom(), message: "telemetry error", kind: "error.kind", stack: "error.stack") },
{ core.telemetry.configuration(batchSize: .mockRandom()) },
{
core.set(
baggage: [
RUMContextAttributes.IDs.applicationID: String.mockRandom(),
RUMContextAttributes.IDs.sessionID: String.mockRandom(),
RUMContextAttributes.IDs.viewID: String.mockRandom(),
RUMContextAttributes.IDs.userActionID: String.mockRandom()
],
forKey: "rum"
{ core.set(
context: RUMCoreContext(
applicationID: .mockRandom(),
sessionID: .mockRandom(),
viewID: .mockRandom(),
userActionID: .mockRandom()
)
}
) }
],
iterations: 50
)
Expand Down
2 changes: 0 additions & 2 deletions DatadogInternal/Sources/Codable/AnyDecodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ extension _AnyDecodable {
self.init(double)
} else if let string = try? container.decode(String.self) {
self.init(string)
} else if let passthrough = container.passthrough() {
self.init(passthrough)
} else if let array = try? container.decode([AnyDecodable].self) {
self.init(array.map { $0.value })
} else if let dictionary = try? container.decode([String: AnyDecodable].self) {
Expand Down
Loading