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

Messages should be ordered by ID if they have the same timecreated

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • 3.1.1
    • None
    • Messages
    • MOODLE_31_STABLE
    • MDL-55783-master
    • Hide

      To test this issue some messages from and to the same user should be sent at the very same time. The quickest way to reproduce that is sending some messages and editing the database doing all messages to have the same timecreated. It would be great to have some read messages also with the same timecreated:

      1. Create one teacher and one student on a course and login as the teacher.
      2. Navigate to the user messages and search the student user.
      3. Send 2 messages, place a number in the message so the first message should have a one, the second a two.
      4. Login as the student and read those messages
      5. Login as the teacher again.
      6. Send 3 more numbered messages (3 to 5).
      7. Now edit the database and change timecreated field to the same value on both tables: message and message_read.
      8. Reload the conversation page and check they are correctly sorted (from oldest to newest).
      Show
      To test this issue some messages from and to the same user should be sent at the very same time. The quickest way to reproduce that is sending some messages and editing the database doing all messages to have the same timecreated. It would be great to have some read messages also with the same timecreated: Create one teacher and one student on a course and login as the teacher. Navigate to the user messages and search the student user. Send 2 messages, place a number in the message so the first message should have a one, the second a two. Login as the student and read those messages Login as the teacher again. Send 3 more numbered messages (3 to 5). Now edit the database and change timecreated field to the same value on both tables: message and message_read. Reload the conversation page and check they are correctly sorted (from oldest to newest).

    Description

      I was testing core_message_send_instant_messages sending several messages at once and I saw that the messages weren't listed in the same order they were sent. At first I thought this was an implementation problem of this WS, so I tried sending them 1 by 1. But since the sending was fast, some messages ended up having the same timecreated, and the display order changed too.

      If two messages have the same timecreated then they should be ordered by ID. This affects both the WS core_message_get_messages and Moodle web.

      Attachments

        Issue Links

          Activity

            People

              pferre22 Pau Ferrer
              dpalou Dani Palou
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: