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

Infinite-loading and failed requests: user cannot re-try unless he reloads the list

XMLWordPrintable

    • Hide
      1. Navigate to a glossary with lots of entries. I.e. In prototype 3.4 > Mobile development course > the first glossary you find.
      2. Use load more button and check it works.
      3. Now go offline and try to load more.
      4. An error should be shown and the "load more" button should become a "Try again" button.
      5. Try to load more only by scrolling to the bottom of the page and check it does not do nothing.
      6. Try to load more clicking on the button. Since you are offline, the error will be shown again.
      7. Check the button works when you go online again.
      Show
      Navigate to a glossary with lots of entries. I.e. In prototype 3.4 > Mobile development course > the first glossary you find. Use load more button and check it works. Now go offline and try to load more. An error should be shown and the "load more" button should become a "Try again" button. Try to load more only by scrolling to the bottom of the page and check it does not do nothing. Try to load more clicking on the button. Since you are offline, the error will be shown again. Check the button works when you go online again.
    • MOODLE_35_STABLE
    • MOODLE_36_STABLE
    • Moodle Mobile 3.6.0

      In our controllers we usually define infinite loading logic like this:

           $scope.loadMoreNotifications = function(){
              fetchNotifications().finally(function() {
                  $scope.$broadcast('scroll.infiniteScrollComplete');
              });
          };
      

      There's a problem with this approach: if the fetch request fails and the data is not cached, we end up with infinite failed calls to WS, because once we broadcast 'scroll.infiniteScrollComplete' the request is performed again.

      The easy way to fix it would be setting this if the request fails:

      $scope.canLoadMore = false;

      This'll make infinite-loading to disappear forever, so the user'll have to do a pull to refresh or something to re-enable it.

      Another option would be to replace the infinite-loading with a "Load more" button if a request fails. That way we stop the infinite executions and we still allow the user to retry it. If the user clicks "Load more" and the request succeeds, we'd show the infinite-loading again.

      What are your thoughts on this, jleyva and fred?

            pferre22 Pau Ferrer
            dpalou Dani Palou
            Albert Gasset Albert Gasset
            Juan Leyva Juan Leyva
            Dani Palou Dani Palou
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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