-
Bug
-
Resolution: Fixed
-
Minor
-
3.4
-
MOODLE_34_STABLE
-
MOODLE_34_STABLE
-
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
- Login to Moodle as the user
- Open the messages notification draw
- Note the order of the messages
- Refresh the page
- 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.