redux-toolkit
redux-toolkit copied to clipboard
Retries are not cleared after calling api.util.resetApiState
Hi @phryneas ,
I ran into this bug today by chance while monitoring a failing API request. I'm using the retry
function combined with baseQuery provided by RTK Query. The "retries" are not automatically cancelled when we call api.util.resetApiState
. Usual behaviour should be to first cancel all pending retries and then reset the API state.
Let me know what you think about this.
Regards, Ayush
Hmm, I can see your point. But I'm not sure how easily that would be doable. I'll add an "enhancement" label and target this to v1.8 - I'll need some time to think this through.
Hmm. I'm looking at this, and yeah, not sure how easy it would be. Looks like retry()
is used to wrap the base query, but that's a very separate thing from "dispatch the resetApiState
action".
Also not sure this is worth adding to 1.9, given that resetApiState
is a rare use case.