adaptyteam / AdaptySDK-Flutter

SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
95 stars 17 forks source link

Blocking requests #57

Closed pyretttt closed 1 year ago

pyretttt commented 2 years ago

I'm not sure, but seems that adapty doesn't allow parallel requests. At least at debug environment. It doesn't start next request until previous doesn't end. It brings many problems is it intentionally done. Or am I wrong?

Below, the same request log. And It seems that there is no timeout. 2022-09-02 22:33:42.677+0500 [Adapty v1.17.7(1)] - INFO 2022-09-02 22:36:43.093+0500 [Adapty v1.17.7(1)] - INFO

How I call:

    if (_product != null) {
      final _productCopy = _product;
      final result = await Adapty.makePurchase(_productCopy);
      if (result.purchaserInfo?.accessLevels['premium']?.isActive ?? false) {
        return true;
      }
    }

    return false;

Environment: iOS: 15.6.1 Flutter: 3.0.5 Adapty: ^1.0.14

pyretttt commented 2 years ago

I think the problem is

private var runningTasksLimit: Int {
        return 1
}
pyretttt commented 2 years ago

Are timeouts configurable on your side?

x401om commented 1 year ago

We do not allow parallel queries, because it is built into the architecture of interaction with our backend. We are now working on a major update, which is designed to optimize this layer, among other things. Speaking of timeouts, yes this is configured inside our sdk and we don't allow it to be changed from the outside.

What exactly is the problem you're facing?

x401om commented 1 year ago

Hey, @pyretttt! We have released version 2 of our SDK, which uses an updated version of iOS SDK under the hood. It has redesigned networking layer, so now requests don't block each other unless the business logic requires this behavior. Read More.