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

Add send message buffering

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Set up

      1. Open message/externallib.php
      2. Find the send_messages_to_conversation function
      3. Add a sleep(2); into the function to make it take longer to respond to the client

      Spam from desktop

      1. Log in as admin
      2. Open the message drawer and go to the message settings
      3. Enable the "Use enter to send" setting
      4. View the admin self conversation in the "Starred" section
      5. Send a few messages as fast as you can (you can just hit enter to send them)
        • I would suggest you use ordered numbers for the messages to make it easier to confirm the order is correct, e.g. 1, then 2, then 3, etc...
      6. CONFIRM that each message is added to the page as soon as you send it
      7. CONFIRM that the message has a loading spinner up the top right while it's being sent to the server
      8. CONFIRM that you can immediately send the next message even while the first one is loading
      9. CONFIRM that when the message is saved on the server the loading spinner is replaced by a time
      10. CONFIRM that the messages are rendered in the UI in the order that they were sent

      Spam from mobile

      1. View your site from a mobile (from an actual mobile, not in "responsive design" mode in the browser)
      2. Log in as admin
      3. Open the message drawer
      4. View the admin self conversation in the "Starred" section
      5. Type in a message and send it by pressing the Return/Enter key on the mobile keyboard (not by clicking on the send icon in the messaging interface)
      6. While that messaging is sending keep pressing the Return/Enter key on the keyboard to try to spam the same message
      7. CONFIRM that you can't spam the same message. It is only added once. The text area should be cleared as soon as the message is first sent.
      8. Try sending a few more messages
      9. CONFIRM that you can keep sending messages while each of the previous messages are being sent (same confirmations as in the "Spam from desktop" test)

      Error sending message

      1. For this test to can revert the changes you made to message/externallib.php
      2. Log in as admin on a desktop browser
      3. Duplicate the page in another tab so that you've got 2 tabs open with the Moodle site
      4. In the first tab open the message drawer and view the self conversation
      5. In the other tab go to site administration > messaging > messaging settings
      6. Disable site messaging by unchecking the "Enable messaging system" checkbox and saving the changes
        • This is going to cause our messages to fail to send
      7. In the first tab try to send a message
      8. CONFIRM that the message fails to send. It should have a red border and it should have a "Retry" link instead of the time at the top right.
      9. Click the retry link
      10. CONFRM it still fails to send
      11. In the other tab enable the site wide messaging again
      12. In the first tab, click the retry link again to try to resend the message
      13. CONFIRM that the message successfully sends. The red border should be gone and the "Retry" link should be changed to the message time.
      Show
      Set up Open message/externallib.php Find the send_messages_to_conversation function Add a sleep(2); into the function to make it take longer to respond to the client Spam from desktop Log in as admin Open the message drawer and go to the message settings Enable the "Use enter to send" setting View the admin self conversation in the "Starred" section Send a few messages as fast as you can (you can just hit enter to send them) I would suggest you use ordered numbers for the messages to make it easier to confirm the order is correct, e.g. 1, then 2, then 3, etc... CONFIRM that each message is added to the page as soon as you send it CONFIRM that the message has a loading spinner up the top right while it's being sent to the server CONFIRM that you can immediately send the next message even while the first one is loading CONFIRM that when the message is saved on the server the loading spinner is replaced by a time CONFIRM that the messages are rendered in the UI in the order that they were sent Spam from mobile View your site from a mobile (from an actual mobile, not in "responsive design" mode in the browser) Log in as admin Open the message drawer View the admin self conversation in the "Starred" section Type in a message and send it by pressing the Return/Enter key on the mobile keyboard (not by clicking on the send icon in the messaging interface) While that messaging is sending keep pressing the Return/Enter key on the keyboard to try to spam the same message CONFIRM that you can't spam the same message. It is only added once. The text area should be cleared as soon as the message is first sent. Try sending a few more messages CONFIRM that you can keep sending messages while each of the previous messages are being sent (same confirmations as in the "Spam from desktop" test) Error sending message For this test to can revert the changes you made to message/externallib.php Log in as admin on a desktop browser Duplicate the page in another tab so that you've got 2 tabs open with the Moodle site In the first tab open the message drawer and view the self conversation In the other tab go to site administration > messaging > messaging settings Disable site messaging by unchecking the "Enable messaging system" checkbox and saving the changes This is going to cause our messages to fail to send In the first tab try to send a message CONFIRM that the message fails to send. It should have a red border and it should have a "Retry" link instead of the time at the top right. Click the retry link CONFRM it still fails to send In the other tab enable the site wide messaging again In the first tab, click the retry link again to try to resend the message CONFIRM that the message successfully sends. The red border should be gone and the "Retry" link should be changed to the message time.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-64002-master-rebased

      Description

      We should create a buffer for sending messaging to allow the user to quickly type and send multiple messages one after another.

      Currently we block the message input after each message is sent until we get confirmation from the server that it was successfully sent.

      This could be changed to immediately add the message to the conversation in the page in a pending state while the request is being sent to the server.

      Once the server responds we can update update the message text to be the server responded text (because it can change).

      If the message fails then we need to indicate that the message failed and allow it to be re-sent.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ryanwyllie Ryan Wyllie
              Reporter:
              ryanwyllie Ryan Wyllie
              Peer reviewer:
              Jake Dallimore
              Integrator:
              Jun Pataleta
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 5 hours, 20 minutes
                  2d 5h 20m