react-select-async-paginate icon indicating copy to clipboard operation
react-select-async-paginate copied to clipboard

Serious Breaking Bug: It keeps on fetching when there is an error on first load

Open saver711 opened this issue 1 year ago • 5 comments

What is the current behavior?

It keeps on fetching when the is error on first load

What is the expected behavior?

it should try once and maybe have retry icon to retry

Sandbox Link

LINK

Reproduce

just change the URL to simulate an error and try to open the select and notice browser's network tab

saver711 avatar Jul 29 '24 11:07 saver711

Hello. I haven't figured out what to do in case of an error. Stopping loading after error doesn't seem a good solution because it may be caused by a short internet disconnection. Perhaps needs to consider a new property like reloadOnErrorTimeout.

As fast solution of your case you can wrap the fetch flow in a try/catch block.

vtaits avatar Jul 29 '24 11:07 vtaits

@vtaits ok but what to do in catch block can u try to edit on the Stackblitz i can't find a way to stop api calls the select is making i really like this package and i want to use it but this behavior breaks the app

Mainly what we need to do is:

  • stop the repetitive api calls
  • a way to request again so that i don't have to refresh the whole browser tab

saver711 avatar Jul 29 '24 11:07 saver711

@saver711 https://stackblitz.com/edit/react-ts-react-select-async-paginate-qyk6df?file=index.tsx

vtaits avatar Jul 29 '24 13:07 vtaits

@vtaits How would you refetch?

saver711 avatar Jul 29 '24 13:07 saver711

Type something in the input or refresh the page. I'll implement reloadOnErrorTimeout in the next version.

vtaits avatar Jul 30 '24 09:07 vtaits

I'm facing the same error, when will this new feature be available?

jpgcarvalho avatar Sep 18 '24 13:09 jpgcarvalho

Hello. Published in 0.7.6

vtaits avatar Sep 18 '24 21:09 vtaits