Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Rate limiting bug #72

@actionshrimp

Description

@actionshrimp

Hi,

I noticed you've put in some client-enforced rate limiting in the client recently:
https://github.com/prismicio/javascript-kit/blob/master/src/utils.js#L176

There appears to be a bug - when trying to build a menu for our site we make 3 calls in parallel to get the contents of a few prismic collections to build various sections. The first two call back OK, but the 3rd one hangs seemingly indefinitely.

Can you explain the reason why there is rate limiting in the client anyway? I've got a few issues with it:

  • I'm making 3 requests in parallel which is well below the stated 20 requests per second, but I'm still getting throttled? Our queries are also cached on our side after the initial fetch so don't happen again anyway.
  • It's pretty easy to bypass by just setting Prismic.Utils.THRESHOLD to 0 / using a different instance of the api client / passing in a different request handler / using a different API client altogether, so if it's to enforce something in your terms of service it seems like enforcing it on the server-side / monitoring requests from particular users and letting them know would be a better way of dealing with it?

Overall it just seems like it's adding complexity (and bugs as I've discovered) without much benefit, and is just making me uneasy about using your client.

Thanks
Dave

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions