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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: xcodebuild -scheme InfomaniakCore build -destination "platform=iOS Simulator,name=iPhone 17 Pro,OS=latest"
run: xcodebuild -scheme InfomaniakCore build -destination "platform=iOS Simulator,name=${{ vars.LATEST_IPHONE_SIMULATOR }},OS=latest"
- name: Test
run: Scripts/prepareForTesting.sh && xcodebuild -scheme InfomaniakCore-Package test -destination "platform=iOS Simulator,name=iPhone 17 Pro,OS=latest" -enableCodeCoverage YES -resultBundlePath ResultBundle.xcresult
run: Scripts/prepareForTesting.sh && xcodebuild -scheme InfomaniakCore-Package test -destination "platform=iOS Simulator,name=${{ vars.LATEST_IPHONE_SIMULATOR }},OS=latest" -enableCodeCoverage YES -resultBundlePath ResultBundle.xcresult
- name: Convert Coverage Report
run: ./Scripts/xccov-to-generic.sh ResultBundle.xcresult > coverage.xml
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 #6.0.0
uses: SonarSource/sonarqube-scan-action@d209202bc7d53ff1cc128f7f907dac145c9d6ae9 #8.3.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand Down
23 changes: 12 additions & 11 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import Foundation
Expand Down
5 changes: 4 additions & 1 deletion Sources/InfomaniakCore/Networking/ApiFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ open class OAuthAuthenticator: Authenticator {

public weak var refreshTokenDelegate: RefreshTokenDelegate?

public init(refreshTokenDelegate: RefreshTokenDelegate) {
public init(refreshTokenDelegate: RefreshTokenDelegate?) {
self.refreshTokenDelegate = refreshTokenDelegate
}

Expand All @@ -284,6 +284,9 @@ open class OAuthAuthenticator: Authenticator {
if let error = error as NSError?, error.domain == "invalid_grant" {
self.refreshTokenDelegate?.didFailRefreshToken(credential)
completion(.failure(error))
} else if let loginError = error as? InfomaniakLoginError,
case .noRefreshToken = loginError {
completion(.failure(loginError))
} else {
// Couldn't refresh the token, keep the old token and fetch it later. Maybe because of bad network ?
completion(.success(credential))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ struct UTDeviceManager_getOrCreateCurrentDevice {
@Test("get a userDevice from the public interface and check stability",
arguments: [Int.random(in: 1 ... 100), Int.random(in: 1 ... 100)])
func currentDevice(userId: Int) async throws {
#if os(iOS)
// GIVEN
let deviceManager = DeviceManager(appGroupIdentifier: "group.infomaniak.deviceassociation",
appMarketingVersion: "1.0.0",
Expand All @@ -226,5 +227,6 @@ struct UTDeviceManager_getOrCreateCurrentDevice {
} catch {
Issue.record("unable to fetch current device twice: \(error)")
}
#endif
}
}
Loading