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

Messaging: Add support for personal space

XMLWordPrintable

    • MOODLE_36_STABLE
    • MOODLE_37_STABLE
    • MDL-64715-master-self-starred-pr-ryan
    • Hide

      Fresh master installation

      Setup

      1. Check that "Enable messaging system (messaging)" is enabled.
      2. Create 2 users: student1 and teacher1.
      3. Create a course.
      4. Enrol student1 as student and teacher1 as editing teacher.

       

      Testing scenario 1: self-conversation

      1. Login as student1.
      2. Click over the message icon to open the message drawer.
      3. CHECK that the self-conversation is displayed in the Starred section.
      4. CHECK the total count is the expected (if only there are a self-conversation, it should be displayed 1).
      5. Access to the self-conversation.
      6. CHECK the self-conversation is opened.
      7. CHECK the header conversation contains the user full name and "Online".
      8. CHECK the header conversation doesn't link to the user profile.
      9. CHECK the header conversation contains a user menu, with the 'Unstar' and 'Delete conversation' options.
      10. CHECK the following self-conversation explanation message is displayed below the header "Personal space. Save draft messages, links, notes etc. to access later."
      11. Send a message.
      12. CHECK the message is sent.
      13. CHECK the self-conversation explanation message is still displayed.
      14. Access to the home page.
      15. Click over the message icon. 
      16. CHECK that the self-conversation is still displayed in the Starred section.
      17. Search the user name or surname for student1 in the message search box.
      18. CHECK that the student1 is displayed on the "Non-contacts" section.
      19. Search some of the texts you've sent.
      20. CHECK that the self-conversation is displayed in the "Messages" section.

      Testing scenario 2: create self-conversation from a bulk message

      1. Login as teacher1.
      2. Access to the participants page of the course.
      3. Select student1 and teacher1 and send them a "Bulk message" (selecting the "Send a message" option from the "With selected users..." list).
      4. Send them a message.
      5. Click over the message icon. 
      6. CHECK that the self-conversation is displayed in the Starred section and it contains the message sent.
      7. Reply to the message.
      8. CHECK that the message is sent.

      Testing scenario 3: export self-conversation

      1. Copy the testexport.php file to the root directory.
      2. Run the php script (testexport.php) to export the user data:

        php testexport.php --username={put the student1 username here}

      3. Access to the folder where the export has been uncompressed. I.e.:  File export was uncompressed to /stable_master/moodledata/temp/privacy/f586ab14-3414-4b73-ac23-4c859500ed0a and open the index.html in a browser.
      4. Expand the student1 user name from the left column and expand also the Messages folder.
      5. CHECK the userid of the student1 user is present.
      6. Expand the userid of the student1 and open the data.json file.
      7. CHECK the self-messages sent previously are there.

      Testing scenario 4: star/unstar and delete self-conversation

      1. Login as student1.
      2. Access to the home page.
      3. Click over the message icon. 
      4. Go to the self-conversation.
      5. Display the menu (...) and Unstar the conversation.
      6. Come back, to see the conversation list.
      7. CHECK the self-conversation is now displayed in the 'Private' section.
      8. Access again to the self-conversation.
      9. Display the menu (...) and Star the conversation again.
      10. Display the menu (...) and click over 'Delete conversation'.
      11. Confirm the conversation should be removed.
      12. Access to the home page and click over the message icon.
      13. CHECK the self-conversation is NOT displayed in the 'Starred' neither the 'Private' sections.
      14. Search the user name or surname for student1 in the message search box.
      15. CHECK that the student1 is displayed on the "Non-contacts" section.

      Testing scenario 5: create self-conversation from the profile

      1. Login as student1.
      2. Access to the user profile.
      3. CHECK that the "Message" icon and text appears near the user name.
      4. Click the "Message" icon.
      5. CHECK an empty self-conversation is opened.
      6. CHECK the header conversation contains the user full name and "Online".
      7. CHECK the header conversation doesn't link to the user profile.
      8. CHECK the header conversation contains a user menu, with the 'Unstar' and 'Delete conversation' options.
      9. Send a message.
      10. CHECK the message is sent.
      11. Access to the home page.
      12. Click over the message icon. 
      13. CHECK that the self-conversation is displayed in the 'Private' section.
      14. CHECK the total count is the expected (if only there are a self-conversation, it should be displayed 1).

       

      Upgrade from 3.4

      A. Setup for Moodle 3.4

      1. Login as admin.
      2. Check that "Enable messaging system (messaging)" is enabled.
      3. Create 4 users: t1, s1, s2 and s3.
      4. From "Site administration > Users > Accounts > Bulk user actions", add all the users to the selection (including admin), choose "Send a message", write any text on the message body (for instance "This is a bulk message sent by the ADMIN"), click over the "Save changes" button and confirm you want to send the message to all these users.
      5. Create a course (C1).
      6. Enrol s1, s2 and s3 as students and t1 as editing teacher.
      7. Logout.
      8. Login as t1.
      9. Access to the C1 course's participants page.
      10. Select all the users (including t1), and in the "With selected users..." list choose "Send a message".
      11. Write a message (for instance "This is a bulk message sent by T1") and click over the "Send message to x people".
      12. Access to the messages page.
      13. CHECK t1 also appears in the list and his self-conversation contains the previous message.
      14. Send a couple of self-messages more to t1.
      15. Logout.
      16. Login as s2.
      17. Access to the messages page.
      18. Reply to admin message.
      19. Reply to t1 message.
      20. Search for s1 and send him a message.
      21. Search for s3 and send him a message.
      22. Logout.

      B. Upgrade to 3.6

      1. Upgrade the code from 3.4 to 3.6.
      2. Login as admin.
      3. Execute the cron.
      4. CHECK the migrate_message_data task is executed (when the cron finishes, all the messages from admin, including the self ones, should be migrated to the new tables).
      5. Access to the messages page using the URL $CFG->wwwroot/message/index.php?id=2 (where 2 should be the admin id).
      6. CHECK admin self-conversation is not empty (it should contain the bulk message sent in step A.4).
      7. Send one self-message more to admin.
      8. CHECK the message can't be sent and a generalexceptionmessage is displayed.
      9. Logout.

      C. Upgrade to master

      1. Upgrade the code from 3.6. to master.
      2. Login as admin and follow the upgrading steps.
      3. Click over the message icon to open the message drawer.
      4. CHECK the self-conversation is displayed in the Starred section (it has been migrated using STEP 1 in the upgrade.php).
      5. Access to the self-conversation.
      6. CHECK the self-conversation contains the first bulk message sent using the "Bulk user actions".
      7. CHECK the self-conversation doesn't contain the message sent in step B.7 (because it hasn't been sent).
      8. Login as t1.
      9. Click over the message icon to open the message drawer.
      10. CHECK the self-conversation is displayed in the Starred section (it has been migrated using STEP 2 in the upgrade.php).
      11. Access to the self-conversation.
      12. CHECK the self-conversation contains the second message sent from the course participants page and also the messages send directly by t1 from the messages page in the step A.14.
      13. Login as s1.
      14. Click over the message icon to open the message drawer.
      15. CHECK the self-conversation is displayed in the Starred section.
      16. Access to the self-conversation.
      17. CHECK the self-conversation doesn't contain any message, only the explanation message should be displayed (it has been migrated using STEP 3 in the upgrade.php).

       

      Some comments about where the messages are stored depending on the Moodle version, just in case the reviewer won't be familiarised with the messaging changes and want to check the database content:

      • In Moodle 3.4, messages can be found in {message} and {message_read} tables, depending if the user has read them or not. Self-messages are always marked as read.
      • In Moodle 3.6:
        • When a user log-in, a migrate_message_data task is added to be executed by the cron. This task will migrate legacy messages from {message} and {message_read} to {messages}. Besides, a conversation is created in {message_conversations}, the members for each conversations are saved in {message_conversation_members} and the actions (like read or deleted messages) are stored in {message_conversation_actions}.
        • For users who don't access, only messages involved with users who have logged-in are migrated. So for the testing instructions, as t1 doesn't log-in to the Moodle 3.6 instance, his messages won't be migrated.
      • In Moodle 3.7:
        • All the self-messages are migrated from the legacy {message} and {message_read} tables.
        • A new conversation type has been added for the self-conversations (3) and {message_conversation_members}for self-conversations should contain only one member.

        

      Besides, some PHPUnit tests have been reviewed/added to cover the API changes.

      Show
      Fresh master installation Setup Check that "Enable messaging system (messaging)" is enabled. Create 2 users: student1 and teacher1. Create a course. Enrol student1 as student and teacher1 as editing teacher.   Testing scenario 1: self-conversation Login as student1. Click over the message icon to open the message drawer. CHECK that the self-conversation is displayed in the Starred section. CHECK the total count is the expected (if only there are a self-conversation, it should be displayed 1). Access to the self-conversation. CHECK  the self-conversation is opened. CHECK  the header conversation contains the user full name and "Online". CHECK  the header conversation doesn't link to the user profile. CHECK the header conversation contains a user menu, with the 'Unstar' and 'Delete conversation' options. CHECK the following self-conversation explanation message is displayed below the header "Personal space. Save draft messages, links, notes etc. to access later. " Send a message. CHECK  the message is sent. CHECK the self-conversation explanation message is still displayed. Access to the home page. Click over the message icon.  CHECK that the self-conversation is still displayed in the Starred section. Search the user name or surname for student1 in the message search box. CHECK that the student1 is displayed on the "Non-contacts" section. Search some of the texts you've sent. CHECK that the self-conversation is displayed in the "Messages" section. Testing scenario 2: create self-conversation from a bulk message Login as teacher1. Access to the participants page of the course. Select student1 and teacher1 and send them a "Bulk message" (selecting the "Send a message" option from the "With selected users..." list). Send them a message. Click over the message icon.  CHECK that the self-conversation is displayed in the Starred section and it contains the message sent. Reply to the message. CHECK that the message is sent. Testing scenario 3: export self-conversation Copy the testexport.php file to the root directory. Run the php script (testexport.php) to export the user data: php testexport.php --username={put the student1 username here} Access to the folder where the export has been uncompressed. I.e.:  File export was uncompressed to /stable_master/moodledata/temp/privacy/f586ab14-3414-4b73-ac23-4c859500ed0a  and open the index.html in a browser. Expand the student1 user name from the left column and expand also the Messages folder. CHECK the userid of the student1 user is present. Expand the userid of the student1 and open the data.json file. CHECK the self-messages sent previously are there. Testing scenario 4: star/unstar and delete self-conversation Login as student1. Access to the home page. Click over the message icon.  Go to the self-conversation. Display the menu (...) and Unstar the conversation. Come back, to see the conversation list. CHECK the self-conversation is now displayed in the 'Private' section. Access again to the self-conversation. Display the menu (...) and Star the conversation again. Display the menu (...) and click over 'Delete conversation'. Confirm the conversation should be removed. Access to the home page and click over the message icon. CHECK the self-conversation is NOT displayed in the 'Starred' neither the 'Private' sections. Search the user name or surname for student1 in the message search box. CHECK that the student1 is displayed on the "Non-contacts" section. Testing scenario 5: create self-conversation from the profile Login as student1. Access to the user profile. CHECK that the "Message" icon and text appears near the user name. Click the "Message" icon. CHECK  an empty self-conversation is opened. CHECK  the header conversation contains the user full name and "Online". CHECK  the header conversation doesn't link to the user profile. CHECK the header conversation contains a user menu, with the 'Unstar' and 'Delete conversation' options. Send a message. CHECK  the message is sent. Access to the home page. Click over the message icon.  CHECK that the self-conversation is displayed in the 'Private' section. CHECK the total count is the expected (if only there are a self-conversation, it should be displayed 1).   Upgrade from 3.4 A. Setup for Moodle 3.4 Login as admin. Check that "Enable messaging system (messaging)" is enabled. Create 4 users: t1, s1, s2 and s3. From "Site administration > Users > Accounts > Bulk user actions", add all the users to the selection (including admin), choose "Send a message", write any text on the message body (for instance " This is a bulk message sent by the ADMIN "), click over the "Save changes" button and confirm you want to send the message to all these users. Create a course (C1). Enrol s1, s2 and s3 as students and t1 as editing teacher. Logout. Login as t1. Access to the C1 course's participants page. Select all the users (including t1), and in the "With selected users..." list choose "Send a message". Write a message (for instance " This is a bulk message sent by T1 ") and click over the "Send message to x people". Access to the messages page. CHECK t1 also appears in the list and his self-conversation contains the previous message. Send a couple of self-messages more to t1. Logout. Login as s2. Access to the messages page. Reply to admin message. Reply to t1 message. Search for s1 and send him a message. Search for s3 and send him a message. Logout. B. Upgrade to 3.6 Upgrade the code from 3.4 to 3.6. Login as admin. Execute the cron. CHECK the migrate_message_data task is executed (when the cron finishes, all the messages from admin, including the self ones, should be migrated to the new tables). Access to the messages page using the URL $CFG->wwwroot/message/index.php?id=2 (where 2 should be the admin id). CHECK admin self-conversation is not empty (it should contain the bulk message sent in step A.4). Send one self-message more to admin. CHECK the message can't be sent and a generalexceptionmessage is displayed. Logout. C. Upgrade to master Upgrade the code from 3.6. to master. Login as admin and follow the upgrading steps. Click over the message icon to open the message drawer. CHECK the self-conversation is displayed in the Starred section (it has been migrated using STEP 1 in the upgrade.php). Access to the self-conversation. CHECK  the self-conversation contains the first bulk message sent using the "Bulk user actions". CHECK the self-conversation doesn't contain the message sent in step B.7 (because it hasn't been sent). Login as t1. Click over the message icon to open the message drawer. CHECK the self-conversation is displayed in the Starred section (it has been migrated using STEP 2 in the upgrade.php). Access to the self-conversation. CHECK  the self-conversation contains the second message sent from the course participants page and also the messages send directly by t1 from the messages page in the step A.14. Login as s1. Click over the message icon to open the message drawer. CHECK the self-conversation is displayed in the Starred section. Access to the self-conversation. CHECK the self-conversation doesn't contain any message, only the explanation message should be displayed (it has been migrated using STEP 3 in the upgrade.php).   Some comments about where the messages are stored depending on the Moodle version, just in case the reviewer won't be familiarised with the messaging changes and want to check the database content: In Moodle 3.4, messages can be found in {message} and {message_read} tables, depending if the user has read them or not. Self-messages are always marked as read. In Moodle 3.6: When a user log-in, a migrate_message_data task is added to be executed by the cron. This task will migrate legacy messages from {message} and {message_read} to {messages}. Besides, a conversation is created in {message_conversations}, the members for each conversations are saved in {message_conversation_members} and the actions (like read or deleted messages) are stored in {message_conversation_actions}. For users who don't access, only messages involved with users who have logged-in are migrated. So for the testing instructions, as t1 doesn't log-in to the Moodle 3.6 instance, his messages won't be migrated. In Moodle 3.7: All the self-messages are migrated from the legacy {message} and {message_read} tables. A new conversation type has been added for the self-conversations (3) and {message_conversation_members}for self-conversations should contain only one member.    Besides, some PHPUnit tests have been reviewed/added to cover the API changes.

      For personal space in messaging, a number of things are required:

      • Sending a bulk message from the course or site to one's self must also trigger the email processor for that sender. Currently (3.6 ) it does not. This is in the message manager.
      • personal space conversations should be returned by the relevant APIs and web services.
      • personal space conversations should be displayed in the UI
      • A user should be able to reply to a personal space conversations
      • (as per 3.5 and older) a user should not be able to initiate a personal space conversation with themselves via the messaging UI. It can be achieved only via the bulk messaging.

      We also need to make sure that options like "Block" etc - which don't really make sense when talking about the current user - are removed from the UI.

        1. Contact request sent.png
          Contact request sent.png
          59 kB
        2. deleted_user.png
          deleted_user.png
          50 kB
        3. Flock.png
          Flock.png
          317 kB
        4. Screenshot from 2019-04-15 13-14-11.png
          Screenshot from 2019-04-15 13-14-11.png
          26 kB
        5. Self conversation onboarding.png
          Self conversation onboarding.png
          80 kB
        6. selfconversations1.png
          selfconversations1.png
          18 kB
        7. selfconversations2.png
          selfconversations2.png
          28 kB
        8. selfconversations3.png
          selfconversations3.png
          41 kB
        9. selfconversations4.png
          selfconversations4.png
          44 kB
        10. selfconversations5.png
          selfconversations5.png
          27 kB
        11. selfconversations6.png
          selfconversations6.png
          37 kB
        12. selfconversations7.png
          selfconversations7.png
          21 kB
        13. selfconversations8.png
          selfconversations8.png
          25 kB
        14. selfconversations9.png
          selfconversations9.png
          19 kB
        15. slack-notification.png
          slack-notification.png
          38 kB

            sarjona Sara Arjona (@sarjona)
            jaked Jake Dallimore
            Jake Dallimore Jake Dallimore
            Adrian Greeve Adrian Greeve
            Victor Déniz Falcón Victor Déniz Falcón
            Votes:
            2 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 week Original Estimate - 1 week
                1w
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 2 days, 2 hours, 45 minutes
                1w 2d 2h 45m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.