Same warning here, and I think I found the root cause. It still reproduces on
com.unity.purchasing 5.0.2 (Unity 6000.5.7f1), so this has been around for a while.
Root cause
It is not really a race condition in the general sense — it is a hard ordering
requirement that is neither enforced nor documented:
FetchPurchases() silently discards any owned purchase whose product is not
already in the fetched product catalog.
In Runtime/Stores/Android/GooglePlay/AAR/Utils/GooglePurchaseBuilder.cs:
// line 25 — exceptions are swallowed, only a warning is logged
.IgnoreExceptions<IGooglePurchase, ArgumentException>(LogWarningForException).ToList();
// line 35 — purchases are built from the *cached* product details
var cachedProductDetails = m_CachedQueryProductDetailsService.GetCachedQueriedProducts();
// line 48 — thrown when the purchased SKU is not in that cache
throw new ArgumentException($"Unable to process purchase with order id: {orderId} " +
$"and purchase token: {purchaseToken} because the product details associated " +
$"with the purchased products were not found.");
So if FetchPurchases() resolves before FetchProducts() has populated the cache,
the purchase is dropped, OnPurchasesFetched still fires as a success with an
incomplete (often empty) list, and OnPurchasesFetchFailed is never called.
Deterministic repro
No timing games needed — just make the catalog unavailable:
await storeController.Connect();
storeController.FetchProducts(products); // do NOT await / do not wait for OnProductsFetched
storeController.FetchPurchases(); // owned purchases are discarded 100% of the time
The user owns a non-consumable, Google Play returns it, and the app sees
OnPurchasesFetched with 0 confirmed orders.
Why this is worse than a warning
The caller cannot distinguish “the user owns nothing” from “we threw the user’s
purchases away”. Any code that treats the store as the source of truth for
entitlements — which is the recommended pattern for non-consumables — will
happily revoke a paid entitlement.
That is exactly what happened to us: users who had bought our remove-ads
non-consumable had it silently revoked on launch, and re-purchasing returned
DuplicateTransaction, which of course does not grant anything either.
Real device log (Pixel 7a, Android 16)
23:29:11.683 W/Unity: InAppPurchasing: Unable to process purchase with order id:
GPA.xxxx-xxxx-xxxx-xxxxx and purchase token: xxxx... because the product details
associated with the purchased products were not found.
23:29:11.689 I/Unity: OnPurchasesFetched: 0 confirmed, 0 pending
23:29:11.695 I/Unity: Products fetched: 2 <-- 6 ms too late
On iOS the catalog happened to arrive 462 ms before the purchases, so the same
code worked there. The arrival order is not guaranteed, which is why this looks
like a flaky, platform-specific bug.
Workaround
Call FetchPurchases() from OnProductsFetched, never right after FetchProducts():
private void OnProductsFetched(List<Product> products)
{
// ... handle metadata ...
productsFetched = true;
storeController.FetchPurchases(); // catalog is guaranteed to be ready here
}
Guard every other FetchPurchases() call site on that flag as well
(restore flows, retry-on-failure paths, etc.).
Suggested fix
Either of these would remove the footgun:
- Queue purchase processing until the product details query has completed, or
- Surface it through
OnPurchasesFetchFailed (or an error in the result) instead
of a bare LogWarning, so callers can tell “owns nothing” from “fetch was
incomplete” and avoid revoking entitlements.
The current docs attribute this warning to being offline or to an expired Google
Play cache. The ordering case is far more common and is not mentioned anywhere.