Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-1599

Try to improve the way to unload remote addons

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • DEV backlog
    • Remote addons
    • Medium

      Right now, to unload remote addons we refresh the current page. This is an ugly solution, specially on real devices where it seems that the app has frozen for a few seconds before the real refresh happens.

      An alternative is to destroy and re-create the app, we can show an spinner or something while this process is happening. I tried to do this but I get a lot of errors when bootstrapping the app again, the most common is:

      Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
      Watchers fired in the last 5 iterations: []
      

      How to reproduce this error:

      1. In index.html, change the body to this:

          <body>
            <div ng-app="mm">
                <ion-nav-view></ion-nav-view>
            </div>
          </body>
        

      2. In console, execute the following code:

        var div = angular.element('<div><ion-nav-view></ion-nav-view></div>');
        document.querySelector('div[ng-app="mm"]').remove();
        angular.element(document.body).prepend(div);
        angular.bootstrap(div, ['mm']);
        

      I tried to create a plunkr to reproduce the issue, but with a really simple app it doesn't seem to happen:

      https://plnkr.co/edit/MMGqjOAByoxLtSKuhlgz?p=preview

            dpalou Dani Palou
            dpalou Dani Palou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 3 days, 1 hour, 30 minutes
                3d 1h 30m
                Remaining:
                Remaining Estimate - 3 days, 1 hour, 30 minutes
                3d 1h 30m
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.