[BUG] While listing the audio media list, if the API request fails, the request will be thrown in an infinite loop.
Platform
Win11
Browser
Chrome
Current Behavior
While listing the audio media list, if the API request fails, the request will be thrown in an infinite loop.
Expected Behavior
If this error is not resolved, the server will be subject to endless requests, which will affect server performance and increase costs.
Recurrence Probability
Always
Steps To Reproduce
-
Access the Sound panel.
-
Scroll to the bottom of the Sound list and wait for new sounds to load.
Infinite Scroll Error
Anything else?
To manage the problem, if media data does not arrive during the infinite scrolling phase, a try again button should be displayed to the user. Requests should not automatically send requests to the server.
I'm not able to fully reproduce the bug, if i turn of the internet for a while then it's getting 500 as expected but why would it get err 429?
There may be an endpoint or server-centered rate limiting structure.
api/sounds/search/route.ts
The developed base rate limiting structure uses Redis to track threads. The status of the Redis connection should be checked in production mode to ensure it's working. The 429 error is likely the error code received while attempting to connect to Redis. @ayush18pop @mazeincoding
You might also be getting an error from the endpoint you're sending FreeSounds to. This is likely the source of the error. A workaround is to cache the API request and perform pagination-based Redis caching instead of constantly sending requests.