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

Sometimes 429 (too many requests) #205

Open
jhonatasrm opened this issue Apr 20, 2024 · 3 comments
Open

Sometimes 429 (too many requests) #205

jhonatasrm opened this issue Apr 20, 2024 · 3 comments
Labels
Discussion The intent of the Discussion tag is to precisely that Enhancement New feature or request Help Wanted Extra attention is needed P2 We want this, but it's not totally clear or extremely important

Comments

@jhonatasrm
Copy link
Collaborator

Description

429 - too many requests

Steps to Reproduce

  1. In about:debugging#/runtime/this-firefox add the SUMO Live Helper on Load Temporary Add-on...
  2. Open Inspect
  3. See the console behavior when selecting locales and products

Expected behavior:

Optimize API requests by refraining from calling the API each time a product is selected, which results in multiple API calls. Instead, utilize a single call to retrieve product information. For example:

https://support.mozilla.org/api/2/question/?format=json&ordering=-id&is_solved=false&is_spam=false&is_locked=false&products=ios,firefox,thunderbird&is_taken=false&is_archived=false&locale=pt-BR&num_answers=0

image

Actual behavior:

The API is being called repeatedly for each selected product/locale.

image

System information

  • Operating system: Windows 11 Pro
  • Firefox version: 124.0.2 (64-bit)

Additional Information

Documentation to reference: https://mozilla.github.io/kitsune/api/#optional-arguments

@jhonatasrm jhonatasrm added Enhancement New feature or request Help Wanted Extra attention is needed P2 We want this, but it's not totally clear or extremely important Discussion The intent of the Discussion tag is to precisely that labels Apr 20, 2024
@WesleyBranton
Copy link
Collaborator

If we do this (which sounds like a good idea) this would impose a 20 question limit overall because that's all the API returns. (See #154)

We definitely need a way to get multiple pages of results if we implement this ticket.

@dannycolin
Copy link
Collaborator

@WesleyBranton would you be open to have a broader discussion on refactoring the API? I was also thinking about refactoring our API implementation so we can support more features. Handling multiple pages of results is definitely on the list.

Plus, I wanted a better solution to track the "new" question status. For example, we could keep track of the last update and only fetch from that point when we use the polling mechanism. For older content, we could lazy pull it when needed (e.g. scrolling the list in the popup).

@WesleyBranton
Copy link
Collaborator

It makes sense to try and cover multiple issues if we need to refactor the API. Unfortunately, my schedule is too busy to do any actual coding for these changes though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion The intent of the Discussion tag is to precisely that Enhancement New feature or request Help Wanted Extra attention is needed P2 We want this, but it's not totally clear or extremely important
Projects
None yet
Development

No branches or pull requests

3 participants