Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

finally() handler on promise generates Possibly unhandled rejection #15607

@Rouche

Description

@Rouche

What is the current behavior?
The promise have correct success/error handler but if i add a finally() handler, it triggers the error.

Plunk: http://plnkr.co/edit/eT834BkIEooAMvrVcLDe

Edit: Looks like finally recreates a new Promise() in handleCallback -> resolver and reject this promise,
I was surprised that it returns something already taken care of in the then(), why not just returning the original Promise instead of rejecting a new one?
This means every finally will need to be like this? : finally().then(angular.noop, angular.noop);

It looks weird, not sure how to deal with this situation perfectly.

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.

Chrome / Windows 10
jQuery 1.3.1
Angular 1.6.1

Other information (e.g. stacktraces, related issues, suggestions how to fix)

There is another processQueue() called with a pending promise. Im guessing its the one in finally() and this promise's pur value stay undefined. Wich is the property tested in processChecks()

Strange, because the finally's then() do have success/error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions