Question

What is causing "There is another request in flight trying to perform the same action"?

  • 15 March 2022
  • 4 replies
  • 67 views

Badge +5

Within a local Xcode testing environment we sometimes run in to the following error (which is received from RevenueCat):

Error Domain=RCBackendErrorDomain Code=7638 "There is another request in flight trying to perform the same action."

This is the error that we receive back when we try and make a purchase (within the following code block):

    func purchase(package: Package, completion: @escaping (InAppPurchaseResult) -> Void) {
purchasePackage(package) { _, purchaserInfo, error, userCanceled in
if userCanceled {
completion(.userCancelled)
} else if let error = error {
completion(.failure(error))
print(error)
print(error.localizedDescription)
} else if purchaserInfo?.entitlements.all["unlocked"]?.isActive == true {
completion(.success)
} else {
// According to RevenueCat doc it should never happen
}
}
}

Even though we receive the error, the purchase goes through successfully.

 

The more testing we do, the more we feel that this may be a result of errors in a local Sandbox testing environment. But it would be great to hear if anyone has faced a similar issue and why it exists.

 

We don’t know if this exist in production code (as we haven’t released it yet)!

 

Thanks so much 😄


4 replies

Badge +4

We are seeing this in our backend when we call RevenueCat API to know the state of a user subscription.

Badge +5

We are seeing this in our backend when we call RevenueCat API to know the state of a user subscription.

Same here

Badge +1

We also see this error 

Anyone able to solve this problem ?

["rc_successfullySynced": 1, "NSUnderlyingError": Error Domain=RCBackendErrorDomain Code=7638 "There is another request in flight trying to perform the same action." UserInfo={NSLocalizedDescription=There is another request in flight trying to perform the same action.}, "finishable": 1, "readable_error_code": UNKNOWN, "NSLocalizedDescription": Unknown error.]
 

Userlevel 4
Badge +9

Hello! Sorry for the late reply here, but I just wrote up a guide about this error: 

TLDR: You likely made multiple requests that are attempting to update the same resource in RevenueCat, so RevenueCat blocked them to prevent race conditions. Even a GET /subscribers call can result in updates on RevenueCat’s end - for example, to update the last seen date, refresh the receipt if it hasn’t been refreshed recently, etc. If you get this error it’s safe to retry the request a few seconds later. 

This might happen a little more frequently in sandbox due to the speed at which subscriptions renew. More updates are happening in a short time which may coincide with an API request that the SDK is making. Again, the solution here is to just retry the operation or function call a few seconds later, which should give RevenueCat time to finish processing any updates.

Reply