OpenCut icon indicating copy to clipboard operation
OpenCut copied to clipboard

[BUG] While listing the audio media list, if the API request fails, the request will be thrown in an infinite loop.

Open iguzelofficial2 opened this issue 1 year ago • 4 comments

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.

Image

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

  1. Access the Sound panel.

  2. 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.

iguzelofficial2 avatar Aug 13 '25 11:08 iguzelofficial2

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?

Image

ayush18pop avatar Aug 13 '25 15:08 ayush18pop

Image

There may be an endpoint or server-centered rate limiting structure.

iguzelofficial avatar Aug 14 '25 11:08 iguzelofficial

api/sounds/search/route.ts

Image

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

iguzelofficial avatar Aug 14 '25 11:08 iguzelofficial

Image

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.

iguzelofficial avatar Aug 14 '25 11:08 iguzelofficial