Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$digest errors for the settings controller #28

Open
abjerner opened this issue Mar 5, 2015 · 6 comments
Open

$digest errors for the settings controller #28

abjerner opened this issue Mar 5, 2015 · 6 comments

Comments

@abjerner
Copy link
Member

abjerner commented Mar 5, 2015

I'm getting an error in the backoffice with the last code from the develop branch:

Error: $digest already in progress
    at Error (native)
    at g (http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:87:165)
    at Object.$get.e.$apply (http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:92:362)
    at http://localhost:52607/App_Plugins/Analytics/backoffice/analyticstree/controllers/settings.controller.js:40:20
    at j.promise.then.i (http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:79:437)
    at j.promise.then.i (http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:79:437)
    at j.promise.then.i (http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:79:437)
    at j.promise.then.i (http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:79:437)
    at http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:80:485
    at Object.$get.e.$eval (http://localhost:52607/umbraco/lib/angular/1.1.5/angular.min.js:92:272)

Which is around these lines:

            //Apply
            $scope.$apply(function () {
                $scope.hasAuthd = hasUserAuthd;
            });

Currently it seems to prevent me from authorizing when already authorizing. At least nothing happens, so I assume it is because the controller isn't fully initialized. Not sure whether this also results in other errors.

@warrenbuckley
Copy link
Member

OK maybe me or @bjarnef can take a look into why this is happening. But ultimately the error is quite descriptive and that an Angular Scope DIgest is already processing/updating values whilst this manual/forced way of telling the model to update with $apply seems to be happening whilst another update is going on.

@bjarnef
Copy link
Collaborator

bjarnef commented Mar 6, 2015

@warrenbuckley I think I have seen this error for a while.. or is it something new?

@abjerner
Copy link
Member Author

abjerner commented Mar 6, 2015

I think I first noticed it about a week ago, but it didn't seem to cause any errors at the time. Also I'm not sure these two errors are related - just wanted to post i here before I'd forget about it.

@konius
Copy link

konius commented Feb 4, 2016

I am getting the same error and can't use the Analytics with Umbraco 7.3.4. Anyone solved this?

@bjarnef
Copy link
Collaborator

bjarnef commented Mar 17, 2017

@Emetico
Copy link
Contributor

Emetico commented Jun 15, 2018

Hi Bjarnef.

$timeout(function() {
  $scope.hasAuthd = hasUserAuthd;
});

Seems to fix it. I nolonger get the error.

This was referenced Jul 4, 2018
Emetico added a commit to Emetico/Analytics that referenced this issue Sep 4, 2018
$digest errors for the settings controller umbraco-community#28

umbraco-community#28

Changed $scope.$apply to $timout in Analytics.SettingsController to fix $digest already in progress error.
warrenbuckley pushed a commit that referenced this issue Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants