Solved

Getting 429 - TooManyRequests on Get Subscriber

  • 24 October 2021
  • 2 replies
  • 162 views

Badge

Getting a 429 on the https://api.revenuecat.com/v1/subscribers/app_user_id request. The response body has this:
    {"code":7638,"message":"There is another request in flight trying to perform the same action."}

The requests are made from backend webhook code where two webhook events for the same user get load balanced to two completely different servers. So, I do have 2 outstanding requests for the same user. I'm wondering if there is a way around this since the amount of work to coordinate a single outstanding request per user isn't trivial.

Thanks,
Ken    

icon

Best answer by sundeep 27 October 2021, 22:13

View original

2 replies

Userlevel 3
Badge +8

Hi @Ken Jones! It looks like you may have sent this in as a ticket which I responded to, but just to be on the safe side I’ll also post my reply here:

Yeah so 429 typically indicates "Too Many Requests" but as you see the actual error is just there was two requests that happened too close together for the same user. In your case, this could maybe happen if two webhook events for the same user were sent in rapid succession (this is pretty rare). 

How often are you getting this error? If you're not getting it too often, I'd recommend just retrying after a short period of time. You shouldn't need to coordinate a single outstanding request per user, especially because webhook event volume is usually not that high.

Badge

That was from my co-worker so we did see the response. These are currently from testing sandbox purchases and the accelerated subscription lifecycle. So it may be rare for something like this to happen in production but want to make sure before we ship this product. RevCat does retry on failed webhook return codes so they do all eventually come through. See logging screenshot below (oldest at the bottom). I may just rely on this retry behavior for now and turn the log level down to warn. Thanks for getting back to us. -- Ken

 

Reply