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

Try to improve the way to unload remote addons

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: DEV backlog
    • Fix Version/s: None
    • Component/s: Remote addons
    • Labels:
    • Issue size:
      Medium

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dpalou Dani Palou
              Reporter:
              dpalou Dani Palou
              Participants:
              Component watchers:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  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