Skip to content

Commit

Permalink
Merge pull request #1039 from adobe/staging
Browse files Browse the repository at this point in the history
staging -> main (v5.1.0)
  • Loading branch information
praveek authored May 22, 2024
2 parents ed4f088 + 5135868 commit 12aea88
Show file tree
Hide file tree
Showing 33 changed files with 550 additions and 131 deletions.
4 changes: 2 additions & 2 deletions AEPCore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPCore"
s.version = "5.0.0"
s.version = "5.1.0"

s.summary = "Core library for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
Expand All @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }

s.dependency 'AEPRulesEngine', '>= 5.0.0', '< 6.0.0'
s.dependency 'AEPServices', '>= 5.0.0', '< 6.0.0'
s.dependency 'AEPServices', '>= 5.1.0', '< 6.0.0'


s.source_files = 'AEPCore/Sources/**/*.swift'
Expand Down
36 changes: 22 additions & 14 deletions AEPCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@
24EDE33B26F39F450068A65F /* EventHistoryResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24EDE33A26F39F450068A65F /* EventHistoryResult.swift */; };
2E00098F26D59EA100DE1F3B /* LifecycleV2FunctionalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E00098E26D59EA100DE1F3B /* LifecycleV2FunctionalTests.swift */; };
2E36F6CA26C1D8D200B194D9 /* LifecycleV2DataStoreCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E36F6C926C1D8D200B194D9 /* LifecycleV2DataStoreCacheTests.swift */; };
2EF54C262BF6C69800685C07 /* URLError+Recoverable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF54C252BF6C69800685C07 /* URLError+Recoverable.swift */; };
2EF54C292BF6C87500685C07 /* URLError+RecoverableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF54C272BF6C79100685C07 /* URLError+RecoverableTests.swift */; };
2EF8B38226BCC69C009D6475 /* LifecycleV2DataStoreCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF8B38126BCC69C009D6475 /* LifecycleV2DataStoreCache.swift */; };
3080C53E015AAAF2AC268368 /* Pods_AEPIdentityTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE1AFF2E227272FC92CF7ABE /* Pods_AEPIdentityTests.framework */; };
31DF174F297030D300B4B07F /* MockLoggingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31DF174E297030D300B4B07F /* MockLoggingService.swift */; };
Expand Down Expand Up @@ -830,6 +832,8 @@
2E00098E26D59EA100DE1F3B /* LifecycleV2FunctionalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LifecycleV2FunctionalTests.swift; sourceTree = "<group>"; };
2E36F6C926C1D8D200B194D9 /* LifecycleV2DataStoreCacheTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LifecycleV2DataStoreCacheTests.swift; sourceTree = "<group>"; };
2EE8956F25F8D2BD27B6D4D8 /* Pods-AEPCore.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AEPCore.debug.xcconfig"; path = "Target Support Files/Pods-AEPCore/Pods-AEPCore.debug.xcconfig"; sourceTree = "<group>"; };
2EF54C252BF6C69800685C07 /* URLError+Recoverable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URLError+Recoverable.swift"; sourceTree = "<group>"; };
2EF54C272BF6C79100685C07 /* URLError+RecoverableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URLError+RecoverableTests.swift"; sourceTree = "<group>"; };
2EF8B38126BCC69C009D6475 /* LifecycleV2DataStoreCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LifecycleV2DataStoreCache.swift; sourceTree = "<group>"; };
31DF174E297030D300B4B07F /* MockLoggingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockLoggingService.swift; sourceTree = "<group>"; };
39282143E012E30EEE6674F2 /* Pods_AEPCoreTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AEPCoreTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -1745,6 +1749,7 @@
3F0397ED24BE60910019F095 /* ThreadSafeArray.swift */,
3F0397EF24BE60910019F095 /* ThreadSafeDictionary.swift */,
3F0397F024BE60910019F095 /* URLEncoder.swift */,
2EF54C252BF6C69800685C07 /* URLError+Recoverable.swift */,
);
path = utility;
sourceTree = "<group>";
Expand Down Expand Up @@ -1820,6 +1825,7 @@
3F03981424BE61520019F095 /* ThreadSafeDictionaryTests.swift */,
3F03981324BE61520019F095 /* URLEncoderTests.swift */,
75408CF62948EA0A00C44CE1 /* AtomicCounterTests.swift */,
2EF54C272BF6C79100685C07 /* URLError+RecoverableTests.swift */,
);
path = utility;
sourceTree = "<group>";
Expand Down Expand Up @@ -3387,6 +3393,7 @@
786C001525B8EE6200F26D34 /* HttpConnectionConstants.swift in Sources */,
24C5E15D26B990CB005BEA72 /* MessageGesture.swift in Sources */,
24C5E14D26B8B00B005BEA72 /* MessageSettings.swift in Sources */,
2EF54C262BF6C69800685C07 /* URLError+Recoverable.swift in Sources */,
3F0397DB24BE5FF30019F095 /* NamedCollectionDataStore.swift in Sources */,
3F0397C524BE5FF30019F095 /* CacheEntry.swift in Sources */,
3F0397F524BE60910019F095 /* AtomicCounter.swift in Sources */,
Expand Down Expand Up @@ -3451,6 +3458,7 @@
3F03981824BE61520019F095 /* DataQueueServiceTests.swift in Sources */,
3F03981B24BE61520019F095 /* FileSystemNamedCollectionTest.swift in Sources */,
78F2E2D427FF7B900073CE00 /* ServiceProviderTests.swift in Sources */,
2EF54C292BF6C87500685C07 /* URLError+RecoverableTests.swift in Sources */,
786C004825B8F43E00F26D34 /* DefaultHeadersFormatterTests.swift in Sources */,
246FD08626CC529800FD130B /* MessageGestureRecognizerTests.swift in Sources */,
78AA4EC02509731B00205AE9 /* FileManager+ZipTests.swift in Sources */,
Expand Down Expand Up @@ -3968,7 +3976,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.core;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4002,7 +4010,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.core;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4084,7 +4092,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.signal;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4116,7 +4124,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.signal;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4189,7 +4197,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = come.adobe.aep.services;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4220,7 +4228,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = come.adobe.aep.services;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4362,7 +4370,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.AEPServicesMocks;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4393,7 +4401,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.AEPServicesMocks;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4423,7 +4431,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.lifecycle;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4454,7 +4462,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.lifecycle;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4529,7 +4537,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.identity;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4560,7 +4568,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.identity;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4636,7 +4644,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.AEPCoreMocks;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -4668,7 +4676,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.AEPCoreMocks;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
2 changes: 1 addition & 1 deletion AEPCore/Sources/configuration/ConfigurationConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
struct ConfigurationConstants {
static let EXTENSION_NAME = "com.adobe.module.configuration"
static let FRIENDLY_NAME = "Configuration"
static let EXTENSION_VERSION = "5.0.0"
static let EXTENSION_VERSION = "5.1.0"

static let DATA_STORE_NAME = EXTENSION_NAME

Expand Down
2 changes: 1 addition & 1 deletion AEPCore/Sources/eventhub/EventHubConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum EventHubConstants {
static let XDM_STATE_CHANGE = "Shared state change (XDM)"
static let NAME = "com.adobe.module.eventhub"
static let FRIENDLY_NAME = "EventHub"
static let VERSION_NUMBER = "5.0.0"
static let VERSION_NUMBER = "5.1.0"

enum EventDataKeys {
static let VERSION = "version"
Expand Down
30 changes: 13 additions & 17 deletions AEPCore/Sources/eventhub/ExtensionContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ class ExtensionContainer {

/// The XDM `SharedState` associated with the extension
var xdmSharedState: SharedState?

var sharedStateName: String = "invalidSharedStateName"


/// The shared state name associated with the extension
private var _sharedStateName = "invalidSharedStateName"
var sharedStateName: String {
get { containerQueue.sync { self._sharedStateName } }
set { containerQueue.async { self._sharedStateName = newValue } }
}

/// The extension's dispatch queue
let extensionQueue: DispatchQueue

Expand All @@ -42,25 +47,16 @@ class ExtensionContainer {
/// Listeners array of `EventListeners` for this extension
let eventListeners: ThreadSafeArray<EventListenerContainer>

private var _lastProcessedEvent: Event?

/// The last `Event` that was processed by this extension, nil if no events have been processed
var lastProcessedEvent: Event? {
get {
containerQueue.sync {
return _lastProcessedEvent
}
}
set {
containerQueue.sync {
_lastProcessedEvent = newValue
}
}
private var _lastProcessedEvent: Event?
var lastProcessedEvent: Event? {
get { containerQueue.sync { self._lastProcessedEvent } }
set { containerQueue.async { self._lastProcessedEvent = newValue } }
}

init(_ name: String, _ type: Extension.Type, _ queue: DispatchQueue, completion: @escaping (EventHubError?) -> Void) {
extensionQueue = queue
self.containerQueue = DispatchQueue(label: "\(name).containerqueue")
containerQueue = DispatchQueue(label: "\(name).containerqueue")
eventOrderer = OperationOrderer<Event>()
eventListeners = ThreadSafeArray<EventListenerContainer>()
eventOrderer.setHandler(eventProcessor)
Expand Down
2 changes: 1 addition & 1 deletion AEPCore/Tests/MobileCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class MobileCoreTests: XCTestCase {
"friendlyName" : "mockExtension"
},
"com.adobe.module.configuration" : {
"version" : "5.0.0",
"version" : "5.1.0",
"friendlyName" : "Configuration"
},
Expand Down
4 changes: 2 additions & 2 deletions AEPIdentity.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPIdentity"
s.version = "5.0.0"
s.version = "5.1.0"

s.summary = "Identity extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
Expand All @@ -20,7 +20,7 @@ Pod::Spec.new do |s|

s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }

s.dependency 'AEPCore', '>= 5.0.0', '< 6.0.0'
s.dependency 'AEPCore', '>= 5.1.0', '< 6.0.0'


end
2 changes: 1 addition & 1 deletion AEPIdentity/Sources/IdentityConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Foundation
enum IdentityConstants {
static let EXTENSION_NAME = "com.adobe.module.identity"
static let FRIENDLY_NAME = "Identity"
static let EXTENSION_VERSION = "5.0.0"
static let EXTENSION_VERSION = "5.1.0"

static let DATASTORE_NAME = EXTENSION_NAME

Expand Down
4 changes: 4 additions & 0 deletions AEPIdentity/Sources/IdentityHitProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class IdentityHitProcessor: HitProcessing {
// retry this hit later
Log.debug(label: "\(LOG_TAG):\(#function)", "Retrying Identity hit, request with url \(hit.url.absoluteString) failed with error \(connection.error?.localizedDescription ?? "") and recoverable status code \(connection.responseCode ?? -1)")
completion(false)
} else if let error = connection.error as? URLError, error.isRecoverable {
// retry this hit later as the request failed with a recoverable transport error
Log.debug(label: "\(LOG_TAG):\(#function)", "Retrying Identity hit, request with url \(urlString) failed with error \(connection.error?.localizedDescription ?? "") and recoverable status code \(connection.responseCode ?? -1)")
completion(false)
} else {
// unrecoverable error. delete the hit from the database and continue
Log.warning(label: "\(LOG_TAG):\(#function)", "Dropping Identity hit, request with url \(urlString) failed with error \(connection.error?.localizedDescription ?? "") and unrecoverable status code \(connection.responseCode ?? -1)")
Expand Down
31 changes: 14 additions & 17 deletions AEPIdentity/Sources/IdentityState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,7 @@ class IdentityState {
identityProperties.privacyStatus = newPrivacyStatus

if newPrivacyStatus == .optedOut {
identityProperties.ecid = nil
identityProperties.advertisingIdentifier = nil
identityProperties.blob = nil
identityProperties.locationHint = nil
identityProperties.customerIds?.removeAll()
identityProperties.isAidSynced = false
identityProperties.pushIdentifier = nil
pushIdManager.updatePushId(pushId: nil)
clearIdentifiers()
identityProperties.saveToPersistence()
createSharedState(identityProperties.toEventData(), event)
} else if identityProperties.ecid == nil {
Expand Down Expand Up @@ -337,15 +330,7 @@ class IdentityState {
func resetIdentifiers(event: Event,
createSharedState: ([String: Any], Event) -> Void) {
guard identityProperties.privacyStatus != .optedOut else { return }
// clear the properties
identityProperties.ecid = nil
identityProperties.advertisingIdentifier = nil
identityProperties.blob = nil
identityProperties.locationHint = nil
identityProperties.customerIds?.removeAll()
identityProperties.isAidSynced = false
identityProperties.pushIdentifier = nil
pushIdManager.resetPersistedFlags()
clearIdentifiers()
hitQueue.clear() // clear hit queue

// do a force sync to generate ECID, then save the properties to persistence.
Expand Down Expand Up @@ -479,4 +464,16 @@ class IdentityState {
Log.trace(label: "\(LOG_TAG):\(#function)", "Generating new ECID value \(identityProperties.ecid?.ecidString ?? "nil")")
}
}

/// Clears identifiers in held `IdentityProperties` and resets flags in `PushIdManager`.
private func clearIdentifiers() {
identityProperties.ecid = nil
identityProperties.advertisingIdentifier = nil
identityProperties.blob = nil
identityProperties.locationHint = nil
identityProperties.customerIds?.removeAll()
identityProperties.isAidSynced = false
identityProperties.pushIdentifier = nil
pushIdManager.resetPersistedFlags()
}
}
7 changes: 4 additions & 3 deletions AEPIdentity/Sources/PushIDManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ struct PushIDManager: PushIDManageable {
properties.pushIdentifier = pushId
properties.saveToPersistence()

if pushId?.isEmpty ?? true, !pushEnabled {
let isPushEnabled = pushEnabled
if pushId?.isEmpty ?? true, !isPushEnabled {
updatePushStatusAndSendAnalyticsEvent(enabled: false)
Log.trace(label: "\(LOG_TAG):\(#function)", "First time sending a.push.optin False")
} else if pushId?.isEmpty ?? true, pushEnabled {
} else if pushId?.isEmpty ?? true, isPushEnabled {
updatePushStatusAndSendAnalyticsEvent(enabled: false)
} else if let pushId = pushId, !pushId.isEmpty, !pushEnabled {
} else if let pushId = pushId, !pushId.isEmpty, !isPushEnabled {
updatePushStatusAndSendAnalyticsEvent(enabled: true)
}
}
Expand Down
Loading

0 comments on commit 12aea88

Please sign in to comment.