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

bug($resource): promise not resolved with value returned by responseErrorInterceptor #14837

Closed
gkalpak opened this issue Jun 28, 2016 · 0 comments

Comments

@gkalpak
Copy link
Member

gkalpak commented Jun 28, 2016

Do you want to request a feature or report a bug?
Bug.

What is the current behavior?
Since 71cf28c (landed in master only), when there is either a responseError interceptor, the promise returned by a $resource instance action (or exposed as instance.$promise) is always resolved with the original response, instead of being fulfilled (resolved or rejected) with the value returned by the interceptor.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
Demo (running with 1.5.7 - change versions to snapshot to see the issue)

  • 1.5.7: The promise is rejected with the value returned by the responseError interceptor.
  • snapshot: The promise is resolved (instead of rejected) with the original response (instead of the value returned by the responseError interceptor).

What is the expected behavior?
Behavior on snapshot (eventual 1.6.x) should be the same as on 1.5.x.

What is the motivation / use case for changing the behavior?
Fix a regression.

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.
Works on 1.5.x. Broken on snapshot (eventual 1.6.x).

@gkalpak gkalpak added this to the 1.6.x milestone Jun 28, 2016
@gkalpak gkalpak self-assigned this Jun 28, 2016
gkalpak added a commit to gkalpak/angular.js that referenced this issue Jun 28, 2016
The test currently fail on master, but should pass on 1.5.x.
A subsequent commit will fix the regressions on master.

(This commit should be backportable to 1.5.x.)

Related to angular#14837.
gkalpak added a commit to gkalpak/angular.js that referenced this issue Jun 28, 2016
This fixes a regression introduced with 71cf28c. See angular#14837 for more info.

Fixes angular#14837
petebacondarwin pushed a commit that referenced this issue Jul 18, 2016
The test currently fail on master, but should pass on 1.5.x.
A subsequent commit will fix the regressions on master.

(This commit should be backportable to 1.5.x.)

Related to #14837.
petebacondarwin pushed a commit that referenced this issue Jul 18, 2016
The test currently fail on master, but should pass on 1.5.x.
A subsequent commit will fix the regressions on master.

(This commit should be backportable to 1.5.x.)

Related to #14837.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant