Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

PromiseQueue stopping when a promise is rejected. #7393

@jayther

Description

@jayther

I started using the utils/Async.PromiseQueue for an extension I'm creating (mostly for myself but will be available on GitHub when it's done). PromiseQueue is great, except when a promise in the queue is rejected, and then all of the potential promises in the queue are stuck and not run.

I took a look in the master branch code to look for the issue and indeed, in src/utils/Async in line 490, the PromiseQueue only attaches on the resolved state of the current promise ( .done() ). According to the JSDoc comment on top of .add(), the queue is supposed to go to the next promise regardless if the state of the current promise is resolved or rejected, meaning it should add itself to the current promise's .always().

For a quick fix in my extension, I extended the PromiseQueue to override the .add() function to use .always() instead of .done().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions