Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57543

Auto-bulk Ajax requests into a single request when possible

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Behat

      1. Confirm that the whole suite passes

      Regression test

      1. Confirm that the new assignment grading interface works
      2. Confirm that you can get a token using login/token.php
      3. Confirm that you can upload files using the mobile app
      4. Confirm that you can assert a badge: {{badges/assertion.php}
        • The only way I found to test this was to directly access it: ?b=HASH
      Show
      Behat Confirm that the whole suite passes Regression test Confirm that the new assignment grading interface works Confirm that you can get a token using login/token.php Confirm that you can upload files using the mobile app Confirm that you can assert a badge: {{badges/assertion.php} The only way I found to test this was to directly access it: ?b=HASH
    • Affected Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57543-master

      Description

      Since 3.2 landed, I have noticed that each page loads causes 3 Ajax requests to be made. Those are fetching the flash messages (also called notifications) to display, the count of unread notifications, and the count of unread messages.

      Because those are in separate APIs, it's understandable that they are not bulked, however the AMD Ajax layer could take care of this and group them if they occur in a relatively short amount of time between one another.

      In general, manually bulking Ajax requests is difficult because of the separation of concerns a developer would place in their API. For instance, if you had a function to submit an ajax update, and another function to fetch a list of objects to refresh your view, it is unlikely that your code would combine both requests in one.

      In short, we can bulk Ajax requests, but we are not really using this feature very well.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              fred Frédéric Massart
              Peer reviewer:
              Damyon Wiese
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: