-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix($resource): remove (broken) support for promises as timeout
#13462
fix($resource): remove (broken) support for promises as timeout
#13462
Conversation
… promise This reverts commit 7170f9d. Fixes part of angular#13393.
* should abort the request when resolved. | ||
* - **`timeout`** – `{number}` – timeout in milliseconds.<br /> | ||
* **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are | ||
* **not** supported in $resource, because the same value has to be re-used for multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same value would be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied it from v1.5.x
. I should change it there too, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it makes sense to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments but lgtm |
ed915fe
to
66d1330
Compare
66d1330
to
7fe6201
Compare
@petebacondarwin, I addressed the comments. What about a BC ? Here's the situation:
Do we need a BC notice ? It just occurred me: You said we should recommend an upgrade to 1.5 in the docs and warning message. |
…rted Fixes part of angular#13393.
…ning Promises never worked correctly as values for `timeout` in `$resource`, because the same value has to be re-used for multiple requests (and it is not possible to `angular.copy()` a promise). Now (in addition to ignoring a non-numeric `timeout`), a warning is logged to the console using `$log.debug()`. Partly fixes angular#13393.
7fe6201
to
6d5141e
Compare
I updated the docs and the warning message to add a recommendation to upgrade to |
Yes, we should put a simple BC notice along the lines of your comment #13462 (comment) I think in general it is safer to have BCs where they were not needed rather than the other way around |
Landed as 4748652 and previous three commits. |
This fixes #13393 by:
The commits could/should be squashed before merging. We probably need a BC notice (since the broken support for promises as
timeout
has sneaked intov1.4.8
, right ?