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

MESSAGE_DEFAULT_*_POLL and related $CFG variables are not respected in new messaging UI

XMLWordPrintable

    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-65657-master
    • Hide

      Please test on both 3.6, 3.7 and master.

      Test 1 - Default timeouts

      1. Create a site with at least one non-admin user
      2. Log in as admin
      3. Open the message drawer and search for the other user
      4. Open the developer tools in your browser and observe the networks tab
      5. Send them a message
      6. Wait for about 10 seconds or so
      7. CONFIRM that you see a network request sent for "core_message_get_conversation_messages" this is the messaging drawer polling the server for new messages after the default timeout of 10 seconds
      8. Wait for about 11 seconds or so
      9. CONFIRM you see another network request for messages
      10. Log in as the other user in a different browser (or incognito window)
      11. Open the message drawer and send a message back to the admin user
      12. In the admin user's browser window wait for a few seconds (might have to wait a while)
      13. CONFIRM that the other user's message is displayed in the UI for the admin user

      Test 2 - Overridden timeouts

      1. Log out as admin (and you can close the other user's browser/window too)
      2. In a text editor open the site's config.php file
      3. Add the following lines:

        $CFG->messagingminpoll = 1;
        $CFG->messagingmaxpoll = 3;
        $CFG->messagingtimeoutpoll = 1;

      4. Log in as admin
      5. Open the message drawer
      6. Open the developer tools in your browser and observe the networks tab
      7. CONFIRM that you see a network request sent for "core_message_get_conversation_messages", these should be much more frequent than in the previous test. The time delay between each request should be 1 second, 2 seconds, 3 seconds, 1 second, 2 seconds, 3 seconds... etc
      Show
      Please test on both 3.6, 3.7 and master. Test 1 - Default timeouts Create a site with at least one non-admin user Log in as admin Open the message drawer and search for the other user Open the developer tools in your browser and observe the networks tab Send them a message Wait for about 10 seconds or so CONFIRM that you see a network request sent for "core_message_get_conversation_messages" this is the messaging drawer polling the server for new messages after the default timeout of 10 seconds Wait for about 11 seconds or so CONFIRM you see another network request for messages Log in as the other user in a different browser (or incognito window) Open the message drawer and send a message back to the admin user In the admin user's browser window wait for a few seconds (might have to wait a while) CONFIRM that the other user's message is displayed in the UI for the admin user Test 2 - Overridden timeouts Log out as admin (and you can close the other user's browser/window too) In a text editor open the site's config.php file Add the following lines: $CFG->messagingminpoll = 1; $CFG->messagingmaxpoll = 3; $CFG->messagingtimeoutpoll = 1; Log in as admin Open the message drawer Open the developer tools in your browser and observe the networks tab CONFIRM that you see a network request sent for "core_message_get_conversation_messages", these should be much more frequent than in the previous test. The time delay between each request should be 1 second, 2 seconds, 3 seconds, 1 second, 2 seconds, 3 seconds... etc

      In 3.5 $CFG->messagingminpoll, $CFG->messagingmaxpoll, and, $CFG->messageingtimeoutpoll}} were added to allow overriding of the constants MESSAGE_DEFAULT_MIN_POLL_IN_SECONDS, MESSAGE_DEFAULT_MAX_POLL_IN_SECONDS, and MESSAGE_DEFAULT_TIMEOUT_POLL_IN_SECONDS respectively.

      In the new UI it appears that these constants and CFG variables are not used at all. In the old UI they were used in message/index.php like so:

      $pollmin = !empty($CFG->messagingminpoll) ? $CFG->messagingminpoll : MESSAGE_DEFAULT_MIN_POLL_IN_SECONDS;
      $pollmax = !empty($CFG->messagingmaxpoll) ? $CFG->messagingmaxpoll : MESSAGE_DEFAULT_MAX_POLL_IN_SECONDS;
      $polltimeout = !empty($CFG->messagingtimeoutpoll) ? $CFG->messagingtimeoutpoll : MESSAGE_DEFAULT_TIMEOUT_POLL_IN_SECONDS;
      

      In the new UI the constants that control polling rates appear to be hardcoded in message/amd/src/message_drawer_view_conversation_constants.js - and seem to be different to the defaults from 3.5

        1. MDL-65657.jpg
          61 kB
          Anna Carissa Sadia

            ryanwyllie Ryan Wyllie
            cameron1729 cameron1729
            cameron1729 cameron1729
            Jake Dallimore Jake Dallimore
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 40 minutes
                6h 40m

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