Skip to content
Open
110 changes: 66 additions & 44 deletions AEPEdge.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
platform :ios, '15.0'

# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
Expand Down Expand Up @@ -54,7 +54,8 @@ end
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |bc|
bc.build_settings['TVOS_DEPLOYMENT_TARGET'] = '12.0'
bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
bc.build_settings['TVOS_DEPLOYMENT_TARGET'] = '15.0'
bc.build_settings['SUPPORTED_PLATFORMS'] = 'iphoneos iphonesimulator appletvos appletvsimulator'
bc.build_settings['TARGETED_DEVICE_FAMILY'] = "1,2,3"
end
Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PODS:
- AEPCore (5.12.0):
- AEPRulesEngine (< 6.0.0, >= 5.0.0)
- AEPServices (< 6.0.0, >= 5.12.0)
- AEPEdge (5.1.1):
- AEPEdge (5.2.0):
- AEPCore (< 6.0.0, >= 5.12.0)
- AEPEdgeIdentity (< 6.0.0, >= 5.0.0)
- AEPEdgeConsent (5.0.2):
Expand Down Expand Up @@ -54,14 +54,14 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
AEPAssurance: 3ab00d47a40bc6c6cb2000689e0dcfa595cda250
AEPCore: ec8e326c5bb86c74bfda2de6055bbb82d25cbba6
AEPEdge: b4fe28a3d6ebbc2ed553e51bb1268ceddfda4fa9
AEPEdge: 4583fd61cddb4785d8391b70417e597509d12934
AEPEdgeConsent: b5a54985b79ee0222b1f1fc4b0859f8b8afed07a
AEPEdgeIdentity: 66f3314af3729c15d398fd71662a7702cb1e8cdf
AEPRulesEngine: fe5800653a4bee07b1e41e61b4d5551f0dba557b
AEPServices: 62db5f1060752a890f990b6bbb3a4c893d698476
AEPTestUtils: 2bbed995c8974f6f6d92058db88d6cd2e4a7f869
SwiftLint: 13280e21cdda6786ad908dc6e416afe5acd1fcb7

PODFILE CHECKSUM: 92bb69895448b79aa523a99f61cda67f43890e00
PODFILE CHECKSUM: 36aa15c92787a4e5ae2af17173c30bab00d9c2c5

COCOAPODS: 1.14.3
COCOAPODS: 1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CompletionHandlersManager {
private var edgeEventErrors =
ThreadSafeDictionary<String, [EdgeEventError]>(identifier: "com.adobe.edge.edgeEventErrorsList")

static let shared = CompletionHandlersManager()
nonisolated(unsafe) static let shared = CompletionHandlersManager()
Comment thread
shushinde marked this conversation as resolved.
Resolved

/// Registers a completion handler for the specified `requestEventId`. This handler is invoked when the Edge response content has been
/// handled entirely by the Edge extension, containing a list of `EdgeEventHandle`(s). This list can be empty or can contain one or multiple items
Expand Down
4 changes: 2 additions & 2 deletions Sources/EdgeNetworkHandlers/EdgeBundledBatchingConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ enum EdgeBundledBatchingConfig {
static let BUNDLED_CONFIG_FILE_TYPE = "json"

private static let loadLock = NSLock()
private static var cachedConfig: [String: Any]?
private static var loadAttempted = false
nonisolated(unsafe) private static var cachedConfig: [String: Any]?
nonisolated(unsafe) private static var loadAttempted = false

/// Returns the parsed contents of the bundled batching config file, loading and caching it the
/// first time this is called. Subsequent calls return the cached result without re-reading the
Expand Down
2 changes: 1 addition & 1 deletion Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class NetworkResponseHandler {
/// for the whole batch's stream to close. The highest index and anything still pending complete
/// at stream close (`processResponseOnComplete`), exactly as before. Only relevant to multi-event
/// batched responses; single events, consent, batch-of-1 are unaffected either way.
static var earlyPerEventCompletionEnabled = true
nonisolated(unsafe) static var earlyPerEventCompletionEnabled = true

// the order of the request events matter for matching them with the response events
private var sentEventsWaitingResponse = ThreadSafeDictionary<String, [Event]>()
Expand Down
2 changes: 1 addition & 1 deletion TestApps/TestAppSwiftUI/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import UIKit
import AEPAssurance
#endif

@UIApplicationMain
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
// TODO: Set up the Environment File ID from your Launch property for the preferred environment
private let LAUNCH_ENVIRONMENT_FILE_ID = ""
Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTests/util/FakeIdentityExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FakeIdentityExtension: NSObject, Extension {

var friendlyName: String = "Identity"

static var extensionVersion: String = "1.0.0"
nonisolated(unsafe) static var extensionVersion: String = "1.0.0"

var metadata: [String: String]?

Expand Down
4 changes: 2 additions & 2 deletions Tests/FunctionalTests/util/TestableEdge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import XCTest

/// Spy class used for testing and inspecting `Edge`.
class TestableEdge: Edge {
static public var readyForEventExpectation: XCTestExpectation?
static public var handleExperienceEventRequestExpectation: XCTestExpectation?
static nonisolated(unsafe) public var readyForEventExpectation: XCTestExpectation?
static nonisolated(unsafe) public var handleExperienceEventRequestExpectation: XCTestExpectation?

override func handleExperienceEventRequest(_ event: Event) {
if let expectation = TestableEdge.handleExperienceEventRequestExpectation {
Expand Down
19 changes: 9 additions & 10 deletions Tests/UnitTests/NetworkResponseHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class NetworkResponseHandlerTests: XCTestCase {
}
}

@MainActor
func testAddRemoveWaitingEvents_noConcurrencyCrash_whenCalledFromDifferentThreads() {
let requestId = "test"
let dispatchQueue1 = DispatchQueue(label: "test.queue1", attributes: .concurrent)
Expand All @@ -121,22 +122,20 @@ class NetworkResponseHandlerTests: XCTestCase {
expectation.expectedFulfillmentCount = 100
expectation.assertForOverFulfill = true

nonisolated(unsafe) let handler = networkResponseHandler
let event1 = self.event1
let event2 = self.event2

for _ in 1...100 {
let rand = Int.random(in: 1..<100)
if rand % 2 == 0 {
dispatchQueue1.async { [weak self] in
guard let self = self else {
return
}
XCTAssertNoThrow(self.networkResponseHandler.addWaitingEvents(requestId: requestId, batchedEvents: [self.event1, self.event2]))
dispatchQueue1.async {
XCTAssertNoThrow(handler.addWaitingEvents(requestId: requestId, batchedEvents: [event1, event2]))
expectation.fulfill()
}
} else {
dispatchQueue2.async { [weak self] in
guard let self = self else {
return
}
XCTAssertNoThrow(self.networkResponseHandler.removeWaitingEvents(requestId: requestId))
dispatchQueue2.async {
XCTAssertNoThrow(handler.removeWaitingEvents(requestId: requestId))
expectation.fulfill()
}
}
Expand Down
Loading