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

Plugin pages freeze the app when offline, if not cached

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Waiting for testing
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.2
    • Fix Version/s: None
    • Component/s: Site add-ons
    • Labels:
    • Testing Instructions:
      Hide

      These test instructions assume you're using Moodle Desktop and the developer tools to 'fake' being offline. You can also do the same test using a real device if you switch off its networking at the point where the test wants you to go offline.

      This issue only needs to be tested in 1 OS.

      1. Open the attached local_examplemobile.zip, and extract the 'examplemobile' folder into the 'local' folder of your Moodle installation.
      2. In a web browser, go to the admin page of your Moodle installation (log in as administrator if necessary). Proceed through the screens to install the new plugin.
      3. Using Moodle Desktop (or the app running in Chrome on a computer), log in to your Moodle installation using any working account.
      4. Open the main settings menu (cogwheel icon). You should see 'Page 1' and 'Page 2' options. The two pages actually have the same behaviour other than the heading text, but do not click Page 2 (if you ever click it when online it will invalidate the test and you'll need to delete the site from the app and add it again).
      5. Click on Page 1
        • You should see a message with heading Page 1 and the current time.
      6. Click the Back icon to return to the settings menu.
      7. Press Ctrl+Shift+I to enable the browser developer features within Moodle Desktop.
      8. Select the Network tab.
      9. Tick the Offline checkbox.
      10. Now click Page 2
        • You should see There was a problem connecting to the site popup.
        • The 'Loading' indicator (which may have appeared before) should not be visible any more.
      11. Click OK on the popup.
      12. Click the Back icon.
        • You return to the settings menu.

      Note: Before this fix, the loading indicator did not disappear when the error appeared, and the Back icon didn't work.

      Show
      These test instructions assume you're using Moodle Desktop and the developer tools to 'fake' being offline. You can also do the same test using a real device if you switch off its networking at the point where the test wants you to go offline. This issue only needs to be tested in 1 OS. Open the attached local_examplemobile.zip, and extract the 'examplemobile' folder into the 'local' folder of your Moodle installation. In a web browser, go to the admin page of your Moodle installation (log in as administrator if necessary). Proceed through the screens to install the new plugin. Using Moodle Desktop (or the app running in Chrome on a computer), log in to your Moodle installation using any working account. Open the main settings menu (cogwheel icon). You should see 'Page 1' and 'Page 2' options. The two pages actually have the same behaviour other than the heading text, but do not click Page 2 (if you ever click it when online it will invalidate the test and you'll need to delete the site from the app and add it again). Click on Page 1 You should see a message with heading Page 1 and the current time. Click the Back icon to return to the settings menu. Press Ctrl+Shift+I to enable the browser developer features within Moodle Desktop. Select the Network tab. Tick the Offline checkbox. Now click Page 2 You should see There was a problem connecting to the site popup. The 'Loading' indicator (which may have appeared before) should not be visible any more. Click OK on the popup. Click the Back icon. You return to the settings menu. Note: Before this fix, the loading indicator did not disappear when the error appeared, and the Back icon didn't work.
    • Affected Branches:
      MOODLE_37_STABLE
    • Pull Master Branch:
    • Sprint:
      Moodle App 3.8.0

      Description

      If you are offline and you try to access a page from a plugin where that page has never been loaded before (so there is no cached version), the app appears to 'freeze'. What happens:

      1. You see a warning telling you that you are offline: 'There was a problem connecting to the site. Please check your connection and try again.'
      2. You OK the warning.
      3. There is a 'Loading' spinner still visible.
      4. Press the Back button.
      5. Nothing happens.

      You can also try to go back by pressing the current tab button at the bottom of the app (or left on tablet view). This shows the 'Are you sure you want to go back to' prompt, but when you press OK, nothing happens.

      The cause of this bug is that the app sends an 'ionViewCanLeave' call to the CoreCompileHtmlComponent, which waits for the HTML component to be loaded before processing it. But the HTML component never loads.

      This can be reproduced on phone and on Moodle Desktop.

      I have coded a solution which I will share here along with an example plugin.

        Attachments

          Activity

            People

            • Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Dani Palou
              Integrator:
              Juan Leyva
              Tester:
              Isabel Renedo Rouco
              Participants:
              Component watchers:
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: