Skip to content

"Duplicate purchase update skipped" is not an error, so app just hangs #3176

@SethArchambault

Description

@SethArchambault

Right now if the warning "Duplicate purchase update skipped for..." is triggered, there is no way to know that this has happened, so the app just hangs, waiting around for a purchase success or failure that never comes.

Here's the code at question in the iap codebase, which seems to stop the operation but never errors out:

    private func sendPurchaseUpdate(_ purchase: NitroPurchase) {
...
        if isDuplicate {
            RnIapLog.warn("Duplicate purchase update skipped for \(purchase.productId)")
            return
        }

Here's what my code looks like:

        try {
          iapPurchaseLoading('Purchasing...')
          requestPurchase({
            request: {
              apple: {sku:'monthly'},
              google: {skus:['landgrid.monthly']},
            },
            type: 'subs',
          })
          // This hidden warning can happen in the background: [RnIap] Duplicate purchase update skipped for monthly
          iapPurchaseLoading('Sent Request...')
        } catch(ex) {
          iapPurchaseException(ex)
        }

No exception is thrown here, and neither onPurchaseError or onError are called with this issue, so "Sent Request..." is the last message delivered to the user, and the screen loads forever.

In the Xcode console this message appears: [RnIap] Duplicate purchase update skipped for monthly

Ideally, a message would be sent to onPurchaseError or an onError message, at which point I could begin a restore-purchase process, or show a button to the user to have them trigger it themselves.

What is the recommended way to handle this issue? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions