ngStorage icon indicating copy to clipboard operation
ngStorage copied to clipboard

Protractor fails on pending: - $timeout

Open azachar opened this issue 9 years ago • 3 comments

Hi There, I am experiencing a weird behaviour of ngStorage. Actually browser.waitForAngular() fails on this exception:

The following tasks were pending: -
$timeout: function() {
    var temp$storage;
    _debounce = null;
    if (!angular.equals($storage, _last$storage)) {
        temp$storage = angular.copy(_last$storage);
        angular.forEach($storage, function(v, k) {
            if (angular.isDefined(v) && '$' !== k[0]) {
                webStorage.setItem(storageKeyPrefix + k, serializer(v));
                delete temp$storage[k];
            }
        });
        for (var k in temp$storage) {
            webStorage.removeItem(storageKeyPrefix + k);
        }
        _last$storage = angular.copy($storage);
    }
} - $timeout: function() {
    var temp$storage;
    _debounce = null;
    if (!angular.equals($storage, _last$storage)) {
        temp$storage = angular.copy(_last$storage);
        angular.forEach($storage, function(v, k) {
            if (angular.isDefined(v) && '$' !== k[0]) {
                webStorage.setItem(storageKeyPrefix + k, serializer(v));
                delete temp$storage[k];
            }
        });
        for (var k in temp$storage) {
            webStorage.removeItem(storageKeyPrefix + k);
        }
        _last$storage = angular.copy($storage);
    }
}

Do you have any idea why this is happening?

Thanks a lot!

Cheers, A.

azachar avatar Oct 03 '16 03:10 azachar

Well, actually I just create a fork where instead of $timeout is $interval used. Replacing $timeout with setTimeout did not help. Have a look at https://github.com/azachar/ngStorage-mock

azachar avatar Nov 30 '16 23:11 azachar

hey @azachar did you find any workaround for this?

does the fork work for you ? with your fork seems like I am getting stuck in the exact same point, however, without the $timeout error..

fabianclain avatar Jan 22 '18 17:01 fabianclain

I am using that fork and it seems to be a rock solid so far.

azachar avatar Jan 22 '18 23:01 azachar