Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google status code 410 should be handled as end-of-subscription, instead of error. #153

Closed
jngbng opened this issue Feb 7, 2018 · 8 comments

Comments

@jngbng
Copy link

jngbng commented Feb 7, 2018

Please refer to
https://stackoverflow.com/questions/45688494/google-android-publisher-api-responds-with-410-purchasetokennolongervalid-erro

@voltrue2
Copy link
Owner

voltrue2 commented Feb 8, 2018

Hello

Thank you for reaching out. I will have a look at this!

Cheers

@voltrue2
Copy link
Owner

@jngbng
After looking into this response with 410. It seems that Google is telling us the subscription is no longer valid. I think it should still be treated as an error.
If you think otherwise, would you please provide an example case where you would want this to be treated otherwise?

Cheers!

@eranpolo
Copy link

eranpolo commented Jun 7, 2018

Hi,
@voltrue2 - we just stumbled upon this in our production code (got 410 and mishandled it).

If 410 isn't to be treated as "end-of-subscription", perhaps small changes should still be made:

  1. Info added to the iap docs, otherwise developers will miss this subtlety.
  2. The returned error object should contain the HTTP response code in a clean way, and not just as part of an error string. Will be cleaner to parse and respond to this case.

@voltrue2
Copy link
Owner

voltrue2 commented Jul 5, 2018

@jngbng @eranpolo
My apologies for taking forever to get to this. I just added an error check for this case and now it returns a specific error when the library sees status 410 from Google.

Cheers!

@voltrue2 voltrue2 closed this as completed Jul 5, 2018
@jngbng
Copy link
Author

jngbng commented Jul 26, 2018

@voltrue2
In my opinion, 'error' should be for exceptional cases which has nothing to do with business logic, such as network error or authentication errors.
In this case, I think the response is not temporally unhandleable error and the subscription would not be logically valid for good. Therefore, we would better treat it as 'end-of-subscription' or another logically valid response (not an error). I wonder why google designed this way, though. :(

@anshul-kai
Copy link
Contributor

anshul-kai commented Aug 15, 2018

I'm just encountering this issue as I've only recently started querying older receipts (expired subscriptions). Do we not receive any data for expired subscriptions from Google? It would be very helpful to query data for older receipts.

Thoughts @voltrue2?

@voltrue2
Copy link
Owner

voltrue2 commented Aug 15, 2018 via email

@anshul-kai
Copy link
Contributor

I verified the docs and you're right @voltrue2. I implemented a very hack way to retrieve expiration dates of old receipts. It's a bummer that Google won't provide us data on old receipts.

Regarding mass validation, my particular use case doesn't quite require it. Does Google expose an API to do this or are you considering a wrapper function? A wrapper function won't bring much value IMO as most developers should be able to accomplish this themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants