Can't process multiple of the same consumable product on iOS + confusion around fetching existing purchases

In using the new IAP.5.0.0-pre.4, I think I’ve noticed an issue where you can’t purchase the same consumable item twice. I’m testing in sandbox on iOS, and I can purchase a consumable item and get the OnOrderPending and OnOrderConfirmed callbacks (OnOrderConfirmed once I manually call purchasingService.ConfirmOrder()). However, if I then try to buy the same consumable again, I get the same popups from Apple asking me to sign in and telling me I’m all set, but then nothing happens in Unity, I get no callbacks. In poking around the IAP package, I found these lines in AppleStoreImpl.cs in the OnPurchaseSucceeded method:

if (IsValidPurchaseState(expirationDate, productId))
{
    ProcessValidPurchase(productId, transactionId, originalTransactionId, expirationDate, ownershipType, appAccountToken);
}
else
{
    base.FinishTransaction(null, transactionId);
}

and here is the above IsValidPurchaseState method:

static bool IsValidPurchaseState(string expirationDate, string productId)
{
    return !s_SubscriptionDeduplicationData.Contains(productId + "|" + expirationDate);
}

With some debug logs, I found that the expirationDate is null (which makes sense I think for a consumable product), and since I am ordering the same product, then the productId will of course be the same from purchase to purchase. Following this code then, IsValidPurchaseState() will return false for any subsequent purchase I make of a consumable item, since the productId and expirationDate are always the same. So I can never reach the ProcessValidPurchase() function for subsequent purchases. Is this an oversight? It looks like this is meant to prevent buying multiple of the same subscription, but clearly should not be blocking consumables. Is there something I’m missing?

Additionally, I have a related issue where the OnExistingPurchasesFetched() callback seems inconsistent, or it is at least unclear what purchases this provides. Is this callback supposed to provide me with all orders I have made, both pending and confirmed? That is what I would assume, but if I make a purchase and don’t confirm it, then restart the app, then the number of pending orders that this callback provides does not always increase. The same goes for confirmed orders. I’m bringing this up in the same thread because I believe it is likely very closely related to the above problem of the IAP package not finishing orders when it should.

Would love any input on both of these issues, if these are both problems with the current package and I need to look into different solutions, or if I’ve done something wrong myself somewhere down the line.

Thank you for reporting this issue.

We have confirmed the issue is on our end and have fixed it. We are in the process of releasing IAP 5.0.0-pre.5 with a fix for this which should be out by tomorrow.

For the OnExistingPurchasesFetched, this should return all active subscriptions, non-consumables and pending consumables. Confirmed consumables are not returned by the stores, so we have no way of returning them.
This is being affected by the error above and should work fine in 5.0.0-pre.5.

Incredible! I’ll be on the lookout for it tomorrow, thanks for getting it in