You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix($resource): don't allow using promises as timeout and log a warning
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 fixesangular#13393.
BREAKING CHANGE:
Possible breaking change for users who updated their code to provide a `timeout`
promise for a `$resource` request in version 1.4.8.
Up to v1.4.7 (included), using a promise as a timeout in `$resource`, would silently
fail (i.e. have no effect).
In v1.4.8, using a promise as timeout would have the (buggy) behaviour described
in angular#12657 (comment)
(i.e. it will work as expected for the first time you resolve the promise and will
cancel all subsequent requests after that - one has to re-create the resource
class. This is feature was not documented.)
With this change, using a promise as timeout in 1.4.9 onwsards is not allowed.
It will log a warning and ignore the timeout value.
If you need support for cancellable `$resource` actions, you should upgrade to
version 1.5 or higher.
0 commit comments