axios-cache-interceptor icon indicating copy to clipboard operation
axios-cache-interceptor copied to clipboard

Add a way to ignore CanceledError

Open Wykks opened this issue 1 year ago • 3 comments

What happened?

Following https://github.com/arthurfiorette/axios-cache-interceptor/issues/665 It doesn't seems to be solved, as I have this exact issue. Is there a way to tell a-c-i to ignore CanceledError? Because currently if a request is cached but then the same request is done, but cancelled (because of react strict mode), the cache is deleted. Also, it seems harmless to keep the cache associated to a request, when it's cancelled, regardless of react strict mode. What do you think?

Also thanks for this great library!

axios-cache-interceptor version

1.6.0

Node / Browser Version

N/A

Axios Version

1.7.2

What storage is being used

Memory Storage

Relevant debugging log output

N/A

Wykks avatar Oct 18 '24 14:10 Wykks

Welp that should to it: https://axios-cache-interceptor.js.org/config/request-specifics#cache-staleiferror my bad

Wykks avatar Oct 18 '24 14:10 Wykks

Actually staleIfError is not called at all on cancelled request

Wykks avatar Oct 18 '24 14:10 Wykks

Are you up to a PR?

remember to add unit tests :)

arthurfiorette avatar Oct 18 '24 14:10 arthurfiorette