Undesired behavior via `pauseInstanceWhileRefreshing` flag
See original GitHub issueI am using this library to refresh an OAuth2 token, and it works really well.
Unfortunately, it seems like I’m unable to get it to work exactly as I want. I want it to.
What I want is for it to pause all requests until the refresh flow completes, and retry the other failed requests that were sent before the flow was started.
The library seems to let me do one or the other, but not both.
Here’s what it looks like when I set pauseInstanceWhileRefreshing
to true
:
All of the failed requests are sent before the refresh flow is started (the reset?req=...
as well as the timeout-500
one). The first one (resets?req=3
) is retried after the flow completes, but the others are just dropped.
The other timeout ones are ostensibly sent wile the flow is in-progress, and those are paused until the flow completed (desired behavior).
I’d like a way to retry the pre-flow ones that failed.
Here’s what I get if I turn the flag off:
All of the failed requests are retried, which is exactly what I want, but also requests that are sent after the flow is started are not paused, resulting in more failed requests than necessary.
Still, the failures are hidden from the callers, which is what I want in either case, so that’s good.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Apologies for the delay. Here’s a code sample:
This is the configuration that works as I want it, except that it lets extra failed requests through.
If I add
pauseInstanceWhileRefreshing: true
to the config:This causes some requests to be dropped, and not retried (the if several are sent simultaneously, they all fail, but only one is retried).
I have had the same problem, any solutions? 🤔