adaptyteam / AdaptySDK-Flutter

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

[BUG] isActive is false after the subscription renewed and before receiving the Google Play RTDN #112

Closed jezsung closed 2 months ago

jezsung commented 3 months ago

isActive is false after the subscription renewed and before receiving the Google Play RTDN.

There's a moment between a subscription renewal and the Google Play realtime developer notification. This moment could be a few minutes.

If you listen to the didUpdateProfileStream, it gives you the wrong isActive during this moment, causing the user to lose Premium access.

Please also note that while isActive was false, willRenew was true. I don't think there would be any valid cases where these two variables can have different values.

I found this issue in the Flutter SDK. I assumed the issue would exist on the Android SDK too as this seemed to be an issue caused by the Adapty backend failed to synchronize.

This issue needs to be fixed as soon as possible. I can't rely on the unstable state.

I also posted a question on the Discussion.

Edit:

I tried to tackle this issue by using the willRenew to determine whether the user has Premium access. But if the user canceled the subscription, the willRenew would be false for the rest of the subscription period. It wouldn't be a proper solution.

I also looked up the expiresAt if it always has a future value. But when the isActive is false due to the above issue, the expiresAt still stays the same as before the renewal and it only gets updated when the RTDN is received.

x401om commented 2 months ago

Hi, @jezsung! I apologize for the late response. This issue is not directly related to our SDK, so I have to close it. It could be some kind of backend bug or something similar. As far as I know, our team is in contact with you, and we will reach out to you as soon as it is resolved on our end. Thank you!