When testing in App Store Connect with a sandbox account it always restores the purchase even after I click "Clear purchase history". didRevokeEntitlementsForProductIdentifiers() was never called.
When I test with the StoreKit config file, deleting or refunding the purchase will call didRevokeEntitlementsForProductIdentifiers() and subsequent restores would be empty.
It works well with the config file. I do call SKPaymentQueue.default().finishTransaction(transaction) for purchase, restore and failed.
What is the real App Store going to do? Is a refunded or expired subscription going to be restored when I call SKPaymentQueue.default().restoreCompletedTransactions()?