Skip to content

Commit

Permalink
[MOB-15896] Format metadata.time timestamp in UTC with millisecond pr…
Browse files Browse the repository at this point in the history
…ecision (#51)

* Update Podfile to get AEPCore from Git dev-v3.4.3 branch

* Format Consent metadata.time timestamp to UTC with millisecond precision

* Upate tests to verify timestamps in UTC with millisecond precision

* Move TestUtil folder under Tests

* Rename test utility to iso8601UTCWithMillisecondsString
  • Loading branch information
kevinlind authored Mar 23, 2022
1 parent f13d910 commit 6889e11
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 94 deletions.
17 changes: 14 additions & 3 deletions AEPEdgeConsent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
212C60CD25E570CC00CCECF9 /* Date+ISO8601.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D0F20B25C1EA410091FFBD /* Date+ISO8601.swift */; };
2158820925E57C4C005B830B /* Dictionary+Flatten.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2158820825E57C4C005B830B /* Dictionary+Flatten.swift */; };
2158821225E5A729005B830B /* Dictionary+Flatten.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2158820825E57C4C005B830B /* Dictionary+Flatten.swift */; };
21639FCC25E70FCA000D95E5 /* MockDataStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21639FCB25E70FCA000D95E5 /* MockDataStore.swift */; };
Expand Down Expand Up @@ -57,6 +56,8 @@
B6F6623E2604B3C600BB6DD2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B6F6623C2604B3C600BB6DD2 /* LaunchScreen.storyboard */; };
B6F662412604B3C600BB6DD2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B6F662402604B3C600BB6DD2 /* main.m */; };
B6F6627A2604B8E400BB6DD2 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B6F662792604B8E400BB6DD2 /* SceneDelegate.m */; };
BFCDF45E27E93675005C4849 /* Date+ISO8601.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D0F20B25C1EA410091FFBD /* Date+ISO8601.swift */; };
BFCDF45F27E93676005C4849 /* Date+ISO8601.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D0F20B25C1EA410091FFBD /* Date+ISO8601.swift */; };
D31B97D4D03E8FC4C48ACE7C /* Pods_UnitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 067A0FE95E92A8DBB660F113 /* Pods_UnitTests.framework */; };
E79F67AB7413663981CF93AC /* Pods_FunctionalTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28D5C062DDFEA9266F94C735 /* Pods_FunctionalTests.framework */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -216,6 +217,7 @@
2170713D25BB5BEA0052BACE /* Sources */,
2170714825BB5BEB0052BACE /* UnitTests */,
2170716625BB5CDC0052BACE /* FunctionalTests */,
BFCDF45D27E93662005C4849 /* TestUtils */,
21D4BAA925E9724E00DD11AF /* TestApp */,
B6F6622D2604B3C600BB6DD2 /* TestAppObjc */,
2170713C25BB5BEA0052BACE /* Products */,
Expand Down Expand Up @@ -245,7 +247,6 @@
2170719025BB5F1A0052BACE /* Consent.swift */,
21C095B825BB906A006C1CFE /* ConsentPreferencesManager.swift */,
21C095B225BB9060006C1CFE /* ConsentPreferences.swift */,
21D0F20B25C1EA410091FFBD /* Date+ISO8601.swift */,
2170713F25BB5BEA0052BACE /* Info.plist */,
);
path = Sources;
Expand Down Expand Up @@ -364,6 +365,15 @@
path = Pods;
sourceTree = "<group>";
};
BFCDF45D27E93662005C4849 /* TestUtils */ = {
isa = PBXGroup;
children = (
21D0F20B25C1EA410091FFBD /* Date+ISO8601.swift */,
);
name = TestUtils;
path = Tests/TestUtils;
sourceTree = "<group>";
};
E687966F0979FCD2463265A7 /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -794,7 +804,6 @@
2170719825BB5F9B0052BACE /* ConsentConstants.swift in Sources */,
2170719125BB5F1A0052BACE /* Consent.swift in Sources */,
217219E325CC9CDE00639914 /* Consent+PublicAPI.swift in Sources */,
212C60CD25E570CC00CCECF9 /* Date+ISO8601.swift in Sources */,
21C095B325BB9060006C1CFE /* ConsentPreferences.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -806,6 +815,7 @@
21C0964725BF4A21006C1CFE /* MockDataStore.swift in Sources */,
21C0963325BF4928006C1CFE /* ConsentPreferencesManagerTests.swift in Sources */,
2158821225E5A729005B830B /* Dictionary+Flatten.swift in Sources */,
BFCDF45E27E93675005C4849 /* Date+ISO8601.swift in Sources */,
21C0960825BF3429006C1CFE /* ConsentPreferencesTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -814,6 +824,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BFCDF45F27E93676005C4849 /* Date+ISO8601.swift in Sources */,
2158820925E57C4C005B830B /* Dictionary+Flatten.swift in Sources */,
21A9E2A525D1E9690089690E /* ConsentPublicAPITests.swift in Sources */,
21A9E2AB25D1ED910089690E /* EventHub+Testable.swift in Sources */,
Expand Down
20 changes: 10 additions & 10 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ project 'AEPEdgeConsent.xcodeproj'
pod 'SwiftLint', '0.44.0'

target 'AEPEdgeConsent' do
pod 'AEPCore'
pod 'AEPServices'
pod 'AEPCore', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
pod 'AEPServices', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
end

target 'UnitTests' do
pod 'AEPCore'
pod 'AEPServices'
pod 'AEPCore', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
pod 'AEPServices', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
end

target 'FunctionalTests' do
pod 'AEPCore'
pod 'AEPServices'
pod 'AEPCore', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
pod 'AEPServices', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
end

target 'TestApp' do
pod 'AEPCore'
pod 'AEPServices'
pod 'AEPCore', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
pod 'AEPServices', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
end

target 'TestAppObjc' do
pod 'AEPCore'
pod 'AEPServices'
pod 'AEPCore', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
pod 'AEPServices', :git => 'https://github.com/adobe/aepsdk-core-ios', :branch => 'dev-v3.4.3'
end
42 changes: 28 additions & 14 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
PODS:
- AEPCore (3.3.1):
- AEPRulesEngine (= 1.0.1)
- AEPServices (= 3.3.1)
- AEPRulesEngine (1.0.1)
- AEPServices (3.3.1)
- AEPCore (3.4.2):
- AEPRulesEngine (>= 1.1.0)
- AEPServices (>= 3.4.2)
- AEPRulesEngine (1.1.0)
- AEPServices (3.4.2)
- SwiftLint (0.44.0)

DEPENDENCIES:
- AEPCore
- AEPServices
- AEPCore (from `https://github.com/adobe/aepsdk-core-ios`, branch `dev-v3.4.3`)
- AEPServices (from `https://github.com/adobe/aepsdk-core-ios`, branch `dev-v3.4.3`)
- SwiftLint (= 0.44.0)

SPEC REPOS:
trunk:
- AEPCore
- AEPRulesEngine
- AEPServices
- SwiftLint

EXTERNAL SOURCES:
AEPCore:
:branch: dev-v3.4.3
:git: https://github.com/adobe/aepsdk-core-ios
AEPServices:
:branch: dev-v3.4.3
:git: https://github.com/adobe/aepsdk-core-ios

CHECKOUT OPTIONS:
AEPCore:
:commit: b0987c04c2cffdaa6391d703b1be79ed9a798999
:git: https://github.com/adobe/aepsdk-core-ios
AEPServices:
:commit: b0987c04c2cffdaa6391d703b1be79ed9a798999
:git: https://github.com/adobe/aepsdk-core-ios

SPEC CHECKSUMS:
AEPCore: fc1398728b6b2a4dcc8dc96455f69ec144e087c0
AEPRulesEngine: 5075ed294026a12e37bd26fe260f74604d205354
AEPServices: c49e7b6ef17ec9f874b015f68ac7d2436235282f
AEPCore: b01856bf24972e4720cb0511a358d1e68067252a
AEPRulesEngine: bb2927ed5501ddf9754c66e97f8d2b1cf8e33b19
AEPServices: 3214311f239c8cdc6267d757200b05ec0ab05878
SwiftLint: e96c0a8c770c7ebbc4d36c55baf9096bb65c4584

PODFILE CHECKSUM: df8c969b5e4f98f7d1df738b00d9511b06b4b07f
PODFILE CHECKSUM: 4b50ac543b5780ed1cd199e89ea65281089453fe

COCOAPODS: 1.10.1
COCOAPODS: 1.11.2
2 changes: 1 addition & 1 deletion Sources/ConsentPreferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct ConsentPreferences: Codable, Equatable {
/// Sets the provided date as metadata time for current consent preferences
/// - Parameter date: date for the metadata reflecting time of last update
mutating func setTimestamp(date: Date) {
consents[ConsentConstants.EventDataKeys.METADATA] = [ConsentConstants.EventDataKeys.TIME: date.iso8601String]
consents[ConsentConstants.EventDataKeys.METADATA] = [ConsentConstants.EventDataKeys.TIME: date.getISO8601UTCDateWithMilliseconds()]
}

/// Decodes a [String: Any] dictionary into a `ConsentPreferences`
Expand Down
Loading

0 comments on commit 6889e11

Please sign in to comment.