No pending request to flush ! errors when moving from 1.1.3 to 1.1.4 #2431
Description
We're currently trying to migrate from 1.1.3
to 1.1.4
.
While doing so, many of our Ajax logic tests are failing with the No pending request to flush !
error.
When debugging our own code, it looks like the success
method isn't being called anymore when doing a request:
$http.post('/api/' + authorizationService + '/remove_authorization').success(function(){
$scope.user.profile['has_' + authorizationService + '_access_token'] = false;
});
(also tried then
instead of success
, but no luck)
The cause of this error is probably 4ae4681 where there are a lot of changes to the $http
service.
Debugging the angular source code a bit more, it seems like the serverRequest
function in http.js doesn't get executed in 1.1.4
, which means sendReq
never gets fired.
In 1.1.3
does get fired so the success
call actually did happen then.
Has anyone seen this as well and is there a way to fix this?
Example code: https://github.com/ets-berkeley-edu/calcentral/blob/v7/app/assets/javascripts/angular/controllers/calcentralController.js#L90
Example test: https://github.com/ets-berkeley-edu/calcentral/blob/v7/spec/javascripts/calcentral/calcentralControllerSpec.js#L47