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

Order of messages in message notification popup is random

XMLWordPrintable

    • MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • 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.

      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.

            nmagill Neill Magill
            nmagill Neill Magill
            Ryan Wyllie Ryan Wyllie
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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