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

Order of messages in message notification popup is random

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: JavaScript, Messages
    • Labels:
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Testing Instructions:
      Hide

      Notifications and messaging:

      • Create a course, make yourself a teacher of the course
      • Add an assignment to the course
      • Enable 'Notify graders about submissions setting
      • Go to the notification settings (notification menu -> settings cog) and enable 'Assignment notifications' -> Web Online and Offline. Do this for the student and the teacher.
      • As a student submit the assignment
      • Run the cron to send the assignment notifications.
      • As the teacher, you should have a notification in the site header
      • Click the notificaitons icon
      • VERIFY: the notification is displayed in the notifications popover
      • VERIFY: you can click the popover and view the full notificaiton
      • VERIFY: the notifications are rendered correctly when visiting
        http://my.moodle/message/output/popup/notifications.php
      • On another user with no notifications..
      • VERIFY the popover displays no notifications fine.

      Messaging

      • Have a student and teacher message each other
      • VERIFY: the popover works and message is displayed
      • Have other students message the teacher
      • As the teacher check that on a page refresh the order of messages in the popup stays the same.
      Show
      Notifications and messaging: Create a course, make yourself a teacher of the course Add an assignment to the course Enable 'Notify graders about submissions setting Go to the notification settings (notification menu -> settings cog) and enable 'Assignment notifications' -> Web Online and Offline. Do this for the student and the teacher. As a student submit the assignment Run the cron to send the assignment notifications. As the teacher, you should have a notification in the site header Click the notificaitons icon VERIFY: the notification is displayed in the notifications popover VERIFY: you can click the popover and view the full notificaiton VERIFY: the notifications are rendered correctly when visiting http://my.moodle/message/output/popup/notifications.php On another user with no notifications.. VERIFY the popover displays no notifications fine. Messaging Have a student and teacher message each other VERIFY: the popover works and message is displayed Have other students message the teacher As the teacher check that on a page refresh the order of messages in the popup stays the same.

      Description

      The order of messages in the message popup is random.

      Steps to reproduce

      Assumptions

      • A user that has had many other users message them

      Steps to reproduce

      1. Login to Moodle as the user
      2. Open the messages notification draw
      3. Note the order of the messages
      4. Refresh the page
      5. Note that the order of the messages is likely to have changed

      We would expect the order to be consistent and the same as the order in the AJAX response that is being rendered.

      Having looked at MessagePopoverController.prototype.renderMessages in /messages/output/popup/message_popover_controller.js it looks like there might be a race condition going on with the promises.

      Specifically each message is rendered in parallel and then immediately attached into the page (which means that which ever one finishes rendering first is added first)

      I think the code needs to be changed so that the rendered messages are attached sequentially attached to the page after they have all been rendered.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nmagill Neill Magill
              Reporter:
              nmagill Neill Magill
              Peer reviewer:
              Ryan Wyllie Ryan Wyllie
              Integrator:
              Dan Poltawski Dan Poltawski
              Tester:
              Adrian Greeve Adrian Greeve
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17