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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.1
    • Fix Version/s: None
    • Component/s: Messages
    • Testing Instructions:
      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).
    • Affected Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-55783-master

      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

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: