api/marketplace/listings 429s on Mods Page
Describe the bug
While looking into https://github.com/pixiebrix/pixiebrix-extension/issues/9324 I noticed in Datadog that users are getting a lot of 429s for the api/marketplace/listings GET endpoint.
The main place that we use that endpoint is in MarketplaceListingIcon, which is hit for every icon in the virtualized list on the Mods Page.
To Reproduce
Steps to reproduce the behavior:
- Go to the Mods Page
- Open the DevTools to the Network tab
- Click on "all mods" and scroll through the list until you've seen at least 35 listings (throttle rate is 35/min)
- Observe that you will start seeing 429s for subsequent listing that are dynamically loaded via list virtualization
Actual behavior
429s are being thrown for every new mod list item that is rendered after the first 35 (no 429s should be getting thrown for typical use of the product).
Custom marketplace icons for affected mods are missing and show the default three-cube icon instead.
Expected behavior
429s are being thrown for every new mod list item that is rendered.
Custom marketplace icons show for every mod that has one.
Screenshots/Loom
Desktop (please complete the following information):
- OS: Mac OS
- Browser: Chrome
- Extension Version: 2.1.5
Additional context
A few approaches to the problem:
- Increase the throttle rate for this particular endpoint (current throttle rate is 35/min, this would be a back-end fix)
- I think we fetch all listings on the ModsPage here with the expectation that all those listings will be cached for the individual GET endpoints. That isn't the case. If we wanted to take an RTK Query caching approach, we might leverage the LIST endpoint for marketplace listings