-
Notifications
You must be signed in to change notification settings - Fork 50
Make AppStoreServerAPIClient an actor #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Make AppStoreServerAPIClient an actor #103
Conversation
| } | ||
|
|
||
| // Test helper method to set request override | ||
| internal func setExecuteRequestOverride(_ override: @escaping @Sendable (HTTPClientRequest, Data?) async throws -> HTTPClientResponse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use typealias to improve readability?
|
|
||
| // requestBody passed for testing purposes | ||
| internal func executeRequest(_ urlRequest: HTTPClientRequest, _ requestBody: Data?) async throws -> HTTPClientResponse { | ||
| if let override = executeRequestOverride { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use guard let to improve readability?
guard let executeRequestOverride else {
return try await self.client.execute(urlRequest, timeout: .seconds(30))
}
return try await executeRequestOverride(urlRequest, requestBody)
| typealias RequestVerifier = (HTTPClientRequest, Data?) throws -> () | ||
|
|
||
| typealias RequestVerifier = @Sendable (HTTPClientRequest, Data?) throws -> () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good example to use typealias here!
| import NIOFoundationCompat | ||
| import JWTKit | ||
|
|
||
| final class AppStoreServerAPIClientTests: XCTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you consider migrating this into SwiftTesting to improve CI performance?
aluco100
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.