Skip to content

Fixed race condition on immediate requests cancellation#4261

Merged
jasonsaayman merged 5 commits intoaxios:masterfrom
DigitalBrainJS:fix/cancel-token-race
May 9, 2022
Merged

Fixed race condition on immediate requests cancellation#4261
jasonsaayman merged 5 commits intoaxios:masterfrom
DigitalBrainJS:fix/cancel-token-race

Conversation

@DigitalBrainJS
Copy link
Copy Markdown
Collaborator

Fixes #4260

var i = token._listeners.length;

for (i = 0; i < l; i++) {
while (i-- > 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So smart! I've tested it with my cases, it works 🔥

@jasonsaayman jasonsaayman merged commit de48c5d into axios:master May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition on immediate requests cancellation (a solution is suggested)

4 participants