I am trying to test this simulated Error.
The issue is, I can't get this to trigger through the simulatedError function.
Error will always end up as an unknown error
Example code snippet:
@available(iOS 17.0, *)
func testPurchase_InvalidQuantity() async throws {
// Arrange
testSession.clearTransactions()
testSession.resetToDefaultState()
let productID = "consumable_1"
try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase)
guard let product = await fetchProduct(identifier: productID) else {
XCTFail("Failed to fetch test product")
return
}
let option = Product.PurchaseOption.quantity(4)
let result = await manager.purchase(product: product, options: option)
switch result {
case .success:
XCTFail("Expected failure due to invalid quantity")
case .failure(let error):
print("Received error: \(error.localizedDescription)")
switch error {
case .purchaseError(let purchaseError):
XCTAssertEqual(purchaseError.code, StoreKitPurchaseError.invalidQuantity.code)
default:
XCTFail("Unexpected error: \(error)")
}
}
}
In the above code snippet, I have an Unexpected Error.
But if i remove try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase) I will receive a XCTFail in the success of my result.
So when I set the quantity to a -1, only then can I correctly receive an invalidQuantity.
Does anyone know why the try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase) would fail to work as directed? I have tests for all the generic errors for loadProducts API and the simulatedError works great for them
Post
Replies
Boosts
Views
Activity
Today, I was suddenly unable to access Xcode Cloud.
when viewing in app store connect, it says:
The page you’re looking for can’t be found.
The page you’re looking for does not exist, or you do not have permission to view it.
after about an hour, i could once again see xcode cloud, but without any of my builds. A few minutes after that, a reload put me back to the lack of permission page
Anyone else seeing this?
Trying to create my first Xcode Cloud Workflow, however the default workflow has a primary Repository URL that is in Derived Data for some reason.
I am unable to update this URL even when selecting the drop down. Anyone have any idea on how to fix this?
This is really frustrating because I am unable to get through the final step of workflow creation, connecting my git code:
However, while editing the workflow, when doing choosing which branches to trigger a build from, it is correctly able to detect all my branches, etc
Anyone have any idea on what is happening?
Code that has been consistently stable for a long time now has begun crashing for unknown reasons in my productions apps since the release of 13.5.1
Example 1: Handling a SKPaymentTransaction in the failed case, it is supposed to always be guaranteed an error so my code always force unwrapped it using !. Since first releasing the app 3 years ago until 13.5.1 this has never been an issue before but now the number of crashes regarding this are suddenly increasing, with the last 24 hours seeing 40-50 crashes for this and all my users experiencing this crash are on iOS 13.5.1 or greater
Example 2:
Fatal error: Index out of range: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1103.2.25.8/swift/stdlib/public/core/ContiguousArrayBuffer.swift, line 444
At first glance, this seems pretty obvious. Index array out of bounds, I must have done something silly. Except, wait, my code has been out and stably released for some time now but with the rising adoption of 13.5.1 I have multiple cases of this occurring through my app where it has never been affected before.
Both of these scenarios are rather easy to add aguard to resolve, but I would rather understand the core change that is effecting these to know fundamentally what changed with 13.5.1 that is affecting my app out of nowhere.
If anyone has any ideas, I'd greatly appreciate it