Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[MOB-10402] Fix Tests #876

Merged
merged 141 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
d2620a3
[MOB-10402] Add test reports
sumeruchat Dec 13, 2024
69f5241
[MOB-10402] Add test reports
sumeruchat Dec 13, 2024
7b8e280
[MOB-10402] Add test reports
sumeruchat Dec 13, 2024
b706ad3
[MOB-10402] Fix
sumeruchat Dec 19, 2024
4fc091c
[MOB-10402] Fix
sumeruchat Dec 19, 2024
0cd2f26
[MOB-10402] Fix
sumeruchat Dec 19, 2024
f42781d
[MOB-10402] Fix
sumeruchat Dec 19, 2024
7ed554b
[MOB-10402] Fix
sumeruchat Dec 19, 2024
568ebe9
[MOB-10402] fix
sumeruchat Dec 19, 2024
7579563
Merge branch 'master' into feature/MOB-10402-add-tests
sumeruchat Dec 19, 2024
22343ea
[MOB-9233] Some work on in-app json only
sumeruchat Jan 3, 2025
d9c3230
[MOB-9233] add a test
sumeruchat Jan 3, 2025
6a97003
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
474b3ce
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
a2c02b4
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
a3662cc
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
54af23a
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
a9ba3bd
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
2a5b58c
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
c75ddc6
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
e1c66c3
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
1085d80
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
fcc2ca3
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
60bf79b
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
f181cd8
[MOB-9233] Fixes
sumeruchat Jan 3, 2025
9e6df49
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
49ad2db
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
5d98e00
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
0975447
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
e896aa6
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
49cb033
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
806a820
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
72777bd
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
063b8a0
[MOB-9233] Fix tests
sumeruchat Jan 3, 2025
dc8b1ac
[MOB-9233] Some fixes
sumeruchat Jan 6, 2025
e7b6346
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
97723f6
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
04d9eaf
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
3d031bf
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
a5cb8eb
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
21f1245
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
10fed83
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
dfa49c6
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
ae48057
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
6f924fd
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
d36f12a
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
b4693af
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
2b5ea6d
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
9fb3461
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
2ed9d1f
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
a8f89bb
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
dea9f43
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
55d21f9
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
ae81982
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
697a689
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
4ec5477
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
e708ad5
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
a5d578f
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
e882c40
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
ef3984c
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
090ef0d
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
537f1c3
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
a9d5f1a
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
a670415
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
7076c5a
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
9669e1c
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
a1eac51
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
27e27e1
[MOB-9233] Fixes
sumeruchat Jan 6, 2025
30246b6
[MOB-9233] Updated tests according to the new discussion
sumeruchat Jan 7, 2025
7673242
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
ea1f39d
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
1761de8
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
55e5259
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
7b665de
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
e47139e
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
b152aaa
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
897fe2a
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
9760232
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
ad83f13
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
f2cc52c
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
01d21f2
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
80e9797
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
c0387c6
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
23b0ce8
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
c58b3e5
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
f3b7167
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
8d06f34
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 7, 2025
1d03e8d
[MOB-10364] Update according to new discussiom
sumeruchat Jan 7, 2025
c30a1c7
[MOB-10364] Update according to new discussiom
sumeruchat Jan 7, 2025
886e650
[MOB-10364] Update according to new discussiom
sumeruchat Jan 7, 2025
d667aea
[MOB-10364] Update according to new discussiom
sumeruchat Jan 8, 2025
3557212
[MOB-10364] Update according to new discussiom
sumeruchat Jan 8, 2025
4a13c59
Fixes
sumeruchat Jan 8, 2025
70dd26f
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 8, 2025
67cb3fd
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 8, 2025
cc57564
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 9, 2025
104478f
[MOB-9233] Updated code according to the new discussion
sumeruchat Jan 9, 2025
5c9f46f
Update swift-sdk/Internal/in-app/InAppMessageParser.swift
sumeruchat Jan 9, 2025
6a480df
Update swift-sdk/Internal/in-app/InAppManager.swift
sumeruchat Jan 9, 2025
337ed90
[MOB-10364] Update according to new discussiom
sumeruchat Jan 9, 2025
f529335
Update iOS Simulator destination in run_test.sh for compatibility
sumeruchat Mar 3, 2025
52e88ed
[MOB-10364] Update according to new discussiom
sumeruchat Jan 9, 2025
5f6de08
[MOB-10364] Update according to new discussiom
sumeruchat Jan 9, 2025
25c9ca0
[MOB-9233] Fix tests for json only in app messages (#883)
sumeruchat Jan 10, 2025
eab7521
[MOB-9446] Enhance push notification state tracking in SDKs (#881)
evantk91 Jan 14, 2025
a1ff081
[MOB-10605] prepares version 6.5.9 release (#885)
evantk91 Jan 14, 2025
78a58ae
[MOB-10951] Add mobile framework info to register token request (#884)
sumeruchat Jan 16, 2025
e1496f5
[MOB-10626] removes disable push call (#887)
evantk91 Jan 17, 2025
d520a4f
[MOB-10652] prepares for version 6.5.10 release (#888)
evantk91 Jan 20, 2025
0523ec2
[MOB-10592] Make IterableAPIMobileFrameworkInfo properties and initia…
sumeruchat Jan 24, 2025
b4aca70
[MOB-10709] prepares for version 6.5.11 release (#890)
evantk91 Jan 24, 2025
aaaa176
MOB-10770 Update iOS SDK initialization checks (#891)
joaodordio Jan 31, 2025
7ec6b46
[MOB-10402] To generate an improved commit message, I need more conte…
sumeruchat Mar 3, 2025
cac6bfb
[MOB-10402] Update iOS simulator in CI workflow
sumeruchat Mar 3, 2025
3672871
[MOB-10402] Add OS version to iOS Simulator config
sumeruchat Mar 3, 2025
aef1eb8
[MOB-10402] Select iPhone simulator dynamically
sumeruchat Mar 3, 2025
c953838
[MOB-10402] Fix simulator selection logic in CI workflow
sumeruchat Mar 3, 2025
cda03e8
[MOB-10402] Fix regex for iPhone model parsing
sumeruchat Mar 3, 2025
4c94ce0
[MOB-10402] Update CI to use macos-latest runner
sumeruchat Mar 3, 2025
3c5b19d
[MOB-10402] Fix device name regex in build script
sumeruchat Mar 3, 2025
00b79d1
[MOB-10402] Add swift-sdk.xctestplan to project files
sumeruchat Mar 3, 2025
6c61743
[MOB-10402] Add endpoint test plan to Xcode project
sumeruchat Mar 3, 2025
1340898
[MOB-10402] Update macOS version in CI workflow
sumeruchat Mar 3, 2025
575e19e
[MOB-10402] Update CI to use macOS-latest and iPhone 16 Pro
sumeruchat Mar 3, 2025
76b5ba6
[MOB-10402] Update CI to run on macOS 15
sumeruchat Mar 3, 2025
74f146e
[MOB-10402] Rename test plan to swift-sdk.xctestplan
sumeruchat Mar 3, 2025
2a6b6ff
[MOB-10402] Merge master into feature/MOB-10402-add-tests
sumeruchat Mar 3, 2025
b7e0b04
[MOB-10402] Remove unused test plans from project files
sumeruchat Mar 3, 2025
d0c0098
[MOB-10402] Remove obsolete xctestplan files
sumeruchat Mar 3, 2025
c2a253a
[MOB-10402] Update e2e workflow to macOS 15
sumeruchat Mar 3, 2025
de5318d
[MOB-10402] Fix build output formatting with xcpretty
sumeruchat Mar 3, 2025
5ed6479
[MOB-10402] Add result bundle path to xcodebuild command
sumeruchat Mar 3, 2025
e1d9fa7
[MOB-10402] Add test report generation to e2e workflow
sumeruchat Mar 3, 2025
f115f78
[MOB-10402] Remove redundant test report steps
sumeruchat Mar 3, 2025
4603070
[MOB-10402] Add swift-sdk.xctestplan to project config
sumeruchat Mar 3, 2025
e6ca2db
[MOB-10402] Add endpoint-tests.xctestplan to project
sumeruchat Mar 3, 2025
2123eb7
[MOB-10402] Fix xctestplan paths in project config
sumeruchat Mar 3, 2025
c42691e
[MOB-10402] Fix test plan path in xcscheme files
sumeruchat Mar 3, 2025
73af51f
MOB-10998 Actually Fix Tests (#904)
sumeruchat Mar 6, 2025
18eeca2
[MOB-10402] Add skipped tests to xctestplan
sumeruchat Mar 6, 2025
68d68a6
Merge branch 'master' into feature/MOB-10402-add-tests
evantk91 Mar 13, 2025
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
9 changes: 6 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: pull_request

jobs:
run-tests-job:
runs-on: macos-14
runs-on: macos-15

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -18,10 +18,13 @@ jobs:
gem install erb
gem install xcpretty

- name: Print available simulators
run: xcrun simctl list devices | cat

- name: Build and test
run: |
xcodebuild test -project swift-sdk.xcodeproj -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]}

xcodebuild test -project swift-sdk.xcodeproj -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2' -enableCodeCoverage YES -resultBundlePath TestResults.xcresult CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]}
- name: CocoaPods lint
run: pod lib lint --allow-warnings

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: pull_request

jobs:
run-e2e-job:
runs-on: macos-14
runs-on: macos-15

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -23,3 +23,5 @@ jobs:
in_app_template_id: ${{secrets.E2E_IN_APP_TEMPLATE_ID}}
run: |
./tests/endpoint-tests/scripts/run_test.sh


4 changes: 4 additions & 0 deletions swift-sdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@
8AAA8C832D074C2000DF8220 /* RequestProcessorUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestProcessorUtil.swift; sourceTree = "<group>"; };
8AAA8C842D074C2000DF8220 /* RequestSender.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestSender.swift; sourceTree = "<group>"; };
8AB8D7D12D3805A900DECFE5 /* IterableAPIMobileFrameworkDetector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IterableAPIMobileFrameworkDetector.swift; sourceTree = "<group>"; };
8AC534392D760B6C00F84F44 /* swift-sdk.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "swift-sdk.xctestplan"; sourceTree = "<group>"; };
8AC5343A2D760BD400F84F44 /* endpoint-tests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "endpoint-tests.xctestplan"; sourceTree = "<group>"; };
9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockAuthManager.swift; sourceTree = "<group>"; };
AC02CAA5234E50B5006617E0 /* RegistrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationTests.swift; sourceTree = "<group>"; };
AC05644A26387B54001FB810 /* MockPersistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPersistence.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1538,6 +1540,8 @@
ACFCA72920EB02DB00BFB277 /* tests */ = {
isa = PBXGroup;
children = (
8AC534392D760B6C00F84F44 /* swift-sdk.xctestplan */,
8AC5343A2D760BD400F84F44 /* endpoint-tests.xctestplan */,
AC995F932166EC310099A184 /* common */,
AC28480824AA44C600C1FC7F /* endpoint-tests */,
ACFBEA15262DC68C000935DD /* hosting-apps */,
Expand Down
17 changes: 7 additions & 10 deletions swift-sdk.xcodeproj/xcshareddata/xcschemes/endpoint-tests.xcscheme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -11,6 +11,12 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:tests/endpoint-tests.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -51,15 +57,6 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ACF560D220E443BF000AAC23"
BuildableName = "host-app.app"
BlueprintName = "host-app"
ReferencedContainer = "container:swift-sdk.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
72 changes: 7 additions & 65 deletions swift-sdk.xcodeproj/xcshareddata/xcschemes/swift-sdk.xcscheme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down Expand Up @@ -110,6 +110,12 @@
ReferencedContainer = "container:swift-sdk.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
<TestPlans>
<TestPlanReference
reference = "container:tests/swift-sdk.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -120,56 +126,6 @@
BlueprintName = "unit-tests"
ReferencedContainer = "container:swift-sdk.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "AuthTests/testAsyncAuthTokenRetrieval()">
</Test>
<Test
Identifier = "AuthTests/testAuthTokenChangeWithSameEmail()">
</Test>
<Test
Identifier = "AuthTests/testAuthTokenChangeWithSameUserId()">
</Test>
<Test
Identifier = "AuthTests/testAuthTokenDeletedOnLogout()">
</Test>
<Test
Identifier = "AuthTests/testAuthTokenRetrievalFailureReset()">
</Test>
<Test
Identifier = "AuthTests/testEmailWithTokenPersistence()">
</Test>
<Test
Identifier = "AuthTests/testLogoutUser()">
</Test>
<Test
Identifier = "AuthTests/testNewEmailAndThenChangeToken()">
</Test>
<Test
Identifier = "AuthTests/testNewUserIdAndThenChangeToken()">
</Test>
<Test
Identifier = "AuthTests/testOnNewAuthTokenCallbackCalled()">
</Test>
<Test
Identifier = "AuthTests/testPushRegistrationAfterAuthTokenRetrieval()">
</Test>
<Test
Identifier = "AuthTests/testRefreshTimerQueueRejection()">
</Test>
<Test
Identifier = "AuthTests/testRetryJwtFailure()">
</Test>
<Test
Identifier = "AuthTests/testUpdateEmailAndThenChangeToken()">
</Test>
<Test
Identifier = "AuthTests/testUpdateEmailWithTokenParam()">
</Test>
<Test
Identifier = "AuthTests/testUserIdWithTokenPersistence()">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -210,20 +166,6 @@
BlueprintName = "offline-events-tests"
ReferencedContainer = "container:swift-sdk.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "NetworkConnectivityManagerTests/testConnectivityChange()">
</Test>
<Test
Identifier = "NetworkConnectivityManagerTests/testPollingNetworkMonitor()">
</Test>
<Test
Identifier = "RequestHandlerTests/testFeatureFlagTurnOnOfflineMode()">
</Test>
<Test
Identifier = "TaskRunnerTests/testResumeWhenNetworkIsBackOnline()">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
</TestAction>
Expand Down
14 changes: 7 additions & 7 deletions swift-sdk/Internal/AuthManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ class AuthManager: IterableAuthManagerProtocol {

pendingAuth = false

// Set the new token first
authToken = retrievedAuthToken
storeAuthToken()

if retrievedAuthToken != nil {
let isRefreshQueued = queueAuthTokenExpirationRefresh(retrievedAuthToken, onSuccess: onSuccess)
if !isRefreshQueued {
onSuccess?(authToken)
onSuccess?(retrievedAuthToken) // Use retrievedAuthToken instead of authToken
}
} else {
handleAuthFailure(failedAuthToken: nil, reason: .authTokenNull)
scheduleAuthTokenRefreshTimer(interval: getNextRetryInterval(), successCallback: onSuccess)
}

authToken = retrievedAuthToken

storeAuthToken()
}
Comment on lines +153 to 166
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually makes sense. Might have to match this one in Android later too if thats not happening..

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. We should add to Android.


func handleAuthFailure(failedAuthToken: String?, reason: AuthFailureReason) {
Expand All @@ -180,13 +180,13 @@ class AuthManager: IterableAuthManagerProtocol {
/// schedule a default timer of 10 seconds if we fall into this case
scheduleAuthTokenRefreshTimer(interval: getNextRetryInterval(), successCallback: onSuccess)

return true
return false // Return false since we couldn't queue a valid refresh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

}

let timeIntervalToRefresh = TimeInterval(expirationDate) - dateProvider.currentDate.timeIntervalSince1970 - expirationRefreshPeriod
if timeIntervalToRefresh > 0 {
scheduleAuthTokenRefreshTimer(interval: timeIntervalToRefresh, isScheduledRefresh: true, successCallback: onSuccess)
return true
return true // Only return true when we successfully queue a refresh
}
return false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="16119" systemVersion="19G2021" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="23605" systemVersion="23G80" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="IterableTaskManagedObject" representedClassName="IterableTaskManagedObject" syncable="YES">
<attribute name="attempts" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="blocking" attributeType="Boolean" usesScalarValueType="YES"/>
Expand All @@ -23,7 +23,4 @@
<fetchIndexElement property="scheduledAt" type="Binary" order="ascending"/>
</fetchIndex>
</entity>
<elements>
<element name="IterableTaskManagedObject" positionX="-63" positionY="-18" width="128" height="268"/>
</elements>
</model>
29 changes: 29 additions & 0 deletions tests/endpoint-tests.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"configurations" : [
{
"id" : "D4401795-4D16-4709-9480-E9D329384AB3",
"name" : "Configuration 1",
"options" : {

}
}
],
"defaultOptions" : {
"codeCoverage" : false,
"targetForVariableExpansion" : {
"containerPath" : "container:swift-sdk.xcodeproj",
"identifier" : "ACF560D220E443BF000AAC23",
"name" : "host-app"
}
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:swift-sdk.xcodeproj",
"identifier" : "AC28480624AA44C600C1FC7F",
"name" : "endpoint-tests"
}
}
],
"version" : 1
}
1 change: 1 addition & 0 deletions tests/endpoint-tests/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ xcodebuild -project swift-sdk.xcodeproj \
-scheme endpoint-tests \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,OS=18.1,name=iPhone 16 Pro' \
-resultBundlePath TestResults.xcresult \
test | xcpretty
Loading