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

External functions are returning deleted messages and miss the new time*deleted fields

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.0.3
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide
      1. Create two user accounts (normal authenticated users) user1 and user2
      2. Using the message option, interchange some messages between the two users
      3. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the the both users:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the user1.
        • You need to replace the wstoken with the user1 token, the useridfrom (user1), useridto (user2) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -data 'useridto=2&useridfrom=1&limitfrom=0&limitnum=49&read=1&type=conversations&newestfirst=1&moodlewssettingfilter=true&wsfunction=core_message_get_messages&wstoken=ffbe3a3002f235bf9d01fd93;2D;2D69e10b66' --compressed | python -m "json.tool"

      6. Check that you receive all the messages you sent to the user2
      7. Now, using the web interface, log in as the user1 and delete a couple of the messages sent to the user2
      8. Call the WS again, confirm that you don't see the deleted messages
      9. Run the same WS call but using the user2 token
      10. Confirm that you still see all the messages
      11. Now, log in as user2, an delete one of the messages sent by the user1 (please, delete a message that was also deleted by the user1 in the previous step)
      12. Run the WS again and check that you don't see that message
      Show
      Create two user accounts (normal authenticated users) user1 and user2 Using the message option, interchange some messages between the two users As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the the both users: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user1. You need to replace the wstoken with the user1 token, the useridfrom (user1), useridto (user2) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -data 'useridto=2&useridfrom=1&limitfrom=0&limitnum=49&read=1&type=conversations&newestfirst=1&moodlewssettingfilter=true&wsfunction=core_message_get_messages&wstoken=ffbe3a3002f235bf9d01fd93;2D;2D69e10b66' --compressed | python -m "json.tool" Check that you receive all the messages you sent to the user2 Now, using the web interface, log in as the user1 and delete a couple of the messages sent to the user2 Call the WS again, confirm that you don't see the deleted messages Run the same WS call but using the user2 token Confirm that you still see all the messages Now, log in as user2, an delete one of the messages sent by the user1 (please, delete a message that was also deleted by the user1 in the previous step) Run the WS again and check that you don't see that message
    • Affected Branches:
      MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-52570-master

      Description

      When MDL-29801 was implemented, the external functions (and some API functions like message_get_messages) weren't updated so the Mobile app is returning deleted messages and we don't have a way to filter them.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Mar/16