Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3430

Messaging - Repeat message sent if internet connection drops during sending

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      This issue only needs to be tested in 1 device.

      Please notice that you should be able to edit the Moodle site code to be able to test this issue.

      1. In a 3.6+ site, edit the file message/externallib.php, search the function send_messages_to_conversation and add this line before the return at the end:
        sleep(31000);
      2. In the app, login in that site and open an existing conversation.
      3. Send a couple of messages without any filter: no emoji as text, no censored words, etc. After 30-40 seconds of sending the last one, you should see the messages duplicated: one will show the time it was sent and the other will still be marked as pending to be sent.
      4. Wait for the automatic sync to trigger (it can take up to 10 minutes) or just leave the conversation and open it again. Check that now you only see the messages once and they are no longer pending.
      5. In a 3.5 or older site, edit the file message/externallib.php, search the function send_instant_messages and add this line before the return at the end:
        sleep(31000);
      6. Repeat the steps 2-4 with this site and check that the behaviour is the same.
      Show
      This issue only needs to be tested in 1 device. Please notice that you should be able to edit the Moodle site code to be able to test this issue. In a 3.6+ site, edit the file message/externallib.php , search the function  send_messages_to_conversation and add this line before the return at the end: sleep(31000); In the app, login in that site and open an existing conversation. Send a couple of messages without any filter : no emoji as text, no censored words, etc. After 30-40 seconds of sending the last one, you should see the messages duplicated: one will show the time it was sent and the other will still be marked as pending to be sent. Wait for the automatic sync to trigger (it can take up to 10 minutes) or just leave the conversation and open it again. Check that now you only see the messages once and they are no longer pending. In a 3.5 or older site, edit the file  message/externallib.php , search the function send_instant_messages  and add this line before the return at the end: sleep(31000); Repeat the steps 2-4 with this site and check that the behaviour is the same.
    • Affected Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
    • Sprint:
      Moodle App 3.9.3

      Description

      Sending messages via the moodle mobile app causes repeated / duplicate messages to be sent if the sender's internet connection drops during sending.

      Tested on Moodle 3.8 + Moodle Mobile 3.8.2 (Android).

      The testing instructions below require you to simulate an intermittent mobile internet connection.

      Assumptions

      1, You have a working Moodle site with the mobile app enabled as per moodle docs.
      2, You have the mobile app installed on your phone and connected to your moodle site.
      3, Messaging is enabled on the site and you have sufficient capabilities to send messages to users.

      This is easier to test / replicate using messaging groups, but also affects one to one messaging. See https://docs.moodle.org/38/en/Groups for setting up group messaging. 

      Instructions

      1, Send a message to either a user or a group message via the app.
      2, Quickly, and while the sending 'clock icon' is showing, turn off your mobile internet connection for a while.
      3, Turn your mobile internet back on for 5s then off again. (This is the tricky bit experiment with the timings, try to catch it after your internet has reconnected, but before the 'clock icon' has disappeared.)
      4, Repeat step 3 a few times. 

        Attachments

          Activity

            People

            Assignee:
            dpalou Dani Palou
            Reporter:
            vinnystocker Vinny Stocker
            Participants:
            Component watchers:
            Juan Leyva
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: