trello-kanban-analysis-tool icon indicating copy to clipboard operation
trello-kanban-analysis-tool copied to clipboard

Prevent Trello from returning HTTP 429 (Rate limit exceeded)

Open nicoespeon opened this issue 8 years ago • 3 comments

Trello API has a rate limit of 300 requests per 10 seconds for each API key and no more than 100 requests per 10 second interval for each token: http://help.trello.com/article/838-api-rate-limits

When calculating Lead Time, TKAT lists cards which information is missing over the selected period to retrieve them. Doing so, it might exceed the rate limit. Same thing could happen if user switch between boards quickly.

Trello Driver should handle this case since it seems to break the observable.

Solutions I got in mind:

  • ~~use Trello's webhooks that are not limited − it seems to be the use case for using them.~~ Unfortunately, that looks much more like monitoring than retrieving past history.
  • ~~use Trello's recursion advice and request all of board actions once.~~ Problem is that is not lazy at all. Also, it would require solving #4.
  • throttle / buffer / delay requests in some way to prevent the error from happening
  • ~~use .retryWhen() operator to catch errors when they happen and retry after a decent delay.~~ Looks like there is no such thing with RxJS.

What we need is a way to buffer requests to consume them within delay limitations from Trello API. This just sounds like pausableBuffered: http://rxmarbles.com/#pausableBuffered

We should find a way to pause the input stream, buffering requests when we reach the limit within the defined interval… Then resume the stream as long as limitation is respected (technically, requests could pass every second while the 10 last seconds don't produce more than 100 requests).

To dig it deeper: http://reactivex.io/documentation/operators/backpressure.html


The thing is: Trello requests input is an observable which items are arrays containing cards IDs, each of which will produce a request.

---A----B-------C-----D---->

A = [ "574545f1a9b62eb12d06d61f", "5702ea4ae9363783899936f2", "56ef9c5b204ac6983bb49bb2" ]

There has to be some kind of transformation through observable to use the technique mentioned. Or to find a workaround.

nicoespeon avatar May 25 '16 06:05 nicoespeon

Any update on this or this is now an accepted limitation of Trello?

I am trying to setup a board with a lots of cards, half way through entering the cards, I keep getting this information, and some of which I keyed in (card's details, labeling, etc) all gone when I refreshed it.

As I proceed this happens every other second with missing data, sadly I have to say at this stage Trello becomes unusable. :(

CamelKing avatar Jun 22 '17 12:06 CamelKing

Hi @CamelKing,

This is a limitation from Trello, but this tool should find a workaround to that. Thus, the issue is still open, with a potential lead to a solution described.

However, I don't use this tool these days and I've got a lot of other things to do, so I didn't get back to this one. I can't tell you when this will be solved, but I fear this won't be anytime soon if I bet on my agenda 😅

nicoespeon avatar Jun 23 '17 06:06 nicoespeon

@nicoespeon that's cool :)

CamelKing avatar Jun 27 '17 23:06 CamelKing