google-play-billing-validator icon indicating copy to clipboard operation
google-play-billing-validator copied to clipboard

Support retry for API errors

Open sagimann opened this issue 5 years ago • 1 comments

Description

According to Google API docs, response code 5xx means that we should retry the validation. It would be great to have optional retry settings for the module, so it automatically retries in such cases.

Steps to Reproduce

  1. try to validate using verifySub, for example
  2. simulate 502 Bad Gateway error in code
  3. observe that, currently, the clients do not have any information whether the error was retriable, and the module will not retry the request

Sample code

N/A

Expected behavior:

// I expect the following method would retry in case of retriable 5xx errors, see promise-retry npm for example settings: verifySub(token, { retries: 5 })

Actual behavior:

no retry is currently supported

Versions

2.0.3

sagimann avatar Jun 03 '19 13:06 sagimann

Sounds awesome. Thanks!

Deishelon avatar Jun 03 '19 21:06 Deishelon