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

Deleting a group with group messaging creates orphaned group conversations which are still shown on the UI

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Test 1 - 3.6 only
      1. git checkout 289475f3da6ec7d3eb.
      2. Log in as the Admin.
      3. Create a course.
      4. Enrol students in the course.
      5. Create a group g1 with a few students (remember one of the users (called s1 from now on in testing instructions)) in the course and make sure to enable 'Group messaging'.
      6. Create a group g2 with a few students (make sure to include s1) in the course and make sure to enable 'Group messaging'.
      7. Log in as s1 in another browser and open the messaging panel.
      8. You should be able to see the groups g1 and g2.
      9. Type a few messages in both chats (use an identifier in each message so you know what group you sent it to later, eg. 'Hello Group 1').
      10. Delete a few messages from both group chats.
      11. As the admin go back to the course's groups page and delete g1.
      12. Back on s1's window, refresh the page.
      13. Open the messaging panel.
      14. The group conversation for g1 and g2 should remain.
      15. View the DB table message_conversations and remember the ID of the conversation related to g1.
      16. View the DB tables message_conversations, message_conversation_members, messages and message_user_actions and confirm entries for g1 still remain (use the ID you noted above to do this), for messages you can just look at the content of the message which should show you what group you sent them to (as per instructions in step 4)) and then for message_user_actions look to see there are still actions related to messages in g1 (see the entries in messages for the ID to compare to).
      17. Upgrade to the latest 3.6 version.
      18. Back on s1's window, refresh the page.
      19. Open the messaging panel.
      20. Confirm you can only see the group conversation for g2.
      21. View the DB tables message_conversations, message_conversation_members, messages and message_user_actions and confirm entries for g1 are no longer there.
      Test 2 - master only
      1. git checkout dd8131a8756f533330ea64773076e1ffe1c013d2
      2. Log in as the Admin.
      3. Create a course.
      4. Enrol students in the course.
      5. Create a group g1 with a few students (remember one of the users (called s1 from now on in testing instructions)) in the course and make sure to enable 'Group messaging'.
      6. Create a group g2 with a few students (make sure to include s1) in the course and make sure to enable 'Group messaging'.
      7. Log in as s1 in another browser and open the messaging panel.
      8. You should be able to see the groups g1 and g2.
      9. Type a few messages in both chats (use an identifier in each message so you know what group you sent it to later, eg. 'Hello Group 1').
      10. Delete a few messages from both group chats.
      11. Mute both conversations g1 and g2 (to do this click on the conversation, then on '...' in the top right and then click 'Mute').
      12. As the admin go back to the course's groups page and delete g1.
      13. Back on s1's window, refresh the page.
      14. Open the messaging panel.
      15. The group conversation for g1 and g2 should remain.
      16. View the DB table message_conversations and remember the ID of the conversation related to g1.
      17. View the DB tables message_conversations, message_conversation_members, message_conversation_actions, messages and message_user_actions and confirm entries for g1 still remain (use the ID you noted above to do this), for messages you can just look at the content of the message which should show you what group you sent them to (as per instructions in step 4)) and then for message_user_actions look to see there are still actions related to messages in g1 (see the entries in messages for the ID to compare to).
      18. Upgrade to the latest master (3.7) version.
      19. Back on s1's window, refresh the page.
      20. Open the messaging panel.
      21. Confirm you can only see the group conversation for g2.
      22. View the DB tables message_conversations, message_conversation_members, message_conversation_actions, messages and message_user_actions and confirm entries for g1 are no longer there.
      Test 3 - Both latest master and 3.6
      1. Log in as the Admin.
      2. Create a course.
      3. Enrol students in the course.
      4. Create a group g1 in the course and make sure to enable 'Group messaging'.
      5. Create a group g2 in the course and make sure to enable 'Group messaging'.
      6. Add a student s1 to both groups.
      7. Log in as s1 in another browser and open the messaging panel.
      8. You should be able to see the groups g1 and g2.
      9. As the admin go back to the course's groups page and delete g1.
      10. Back on s1's window, refresh the page.
      11. Open the messaging panel.
      12. Confirm you can only see the group conversation for g2.
      Show
      Test 1 - 3.6 only git checkout 289475f3da6ec7d3eb . Log in as the Admin. Create a course. Enrol students in the course. Create a group g1 with a few students (remember one of the users (called s1 from now on in testing instructions)) in the course and make sure to enable 'Group messaging'. Create a group g2 with a few students (make sure to include s1) in the course and make sure to enable 'Group messaging'. Log in as s1 in another browser and open the messaging panel. You should be able to see the groups g1 and g2. Type a few messages in both chats (use an identifier in each message so you know what group you sent it to later, eg. 'Hello Group 1'). Delete a few messages from both group chats. As the admin go back to the course's groups page and delete g1. Back on s1's window, refresh the page. Open the messaging panel. The group conversation for g1 and g2 should remain. View the DB table message_conversations and remember the ID of the conversation related to g1. View the DB tables message_conversations , message_conversation_members , messages and message_user_actions and confirm entries for g1 still remain (use the ID you noted above to do this), for messages you can just look at the content of the message which should show you what group you sent them to (as per instructions in step 4)) and then for message_user_actions look to see there are still actions related to messages in g1 (see the entries in messages for the ID to compare to). Upgrade to the latest 3.6 version. Back on s1's window, refresh the page. Open the messaging panel. Confirm you can only see the group conversation for g2. View the DB tables message_conversations , message_conversation_members , messages and message_user_actions and confirm entries for g1 are no longer there. Test 2 - master only git checkout dd8131a8756f533330ea64773076e1ffe1c013d2 Log in as the Admin. Create a course. Enrol students in the course. Create a group g1 with a few students (remember one of the users (called s1 from now on in testing instructions)) in the course and make sure to enable 'Group messaging'. Create a group g2 with a few students (make sure to include s1) in the course and make sure to enable 'Group messaging'. Log in as s1 in another browser and open the messaging panel. You should be able to see the groups g1 and g2. Type a few messages in both chats (use an identifier in each message so you know what group you sent it to later, eg. 'Hello Group 1'). Delete a few messages from both group chats. Mute both conversations g1 and g2 (to do this click on the conversation, then on '...' in the top right and then click 'Mute'). As the admin go back to the course's groups page and delete g1. Back on s1's window, refresh the page. Open the messaging panel. The group conversation for g1 and g2 should remain. View the DB table message_conversations and remember the ID of the conversation related to g1. View the DB tables message_conversations , message_conversation_members , message_conversation_actions , messages and message_user_actions and confirm entries for g1 still remain (use the ID you noted above to do this), for messages you can just look at the content of the message which should show you what group you sent them to (as per instructions in step 4)) and then for message_user_actions look to see there are still actions related to messages in g1 (see the entries in messages for the ID to compare to). Upgrade to the latest master (3.7) version. Back on s1's window, refresh the page. Open the messaging panel. Confirm you can only see the group conversation for g2. View the DB tables message_conversations , message_conversation_members , message_conversation_actions , messages and message_user_actions and confirm entries for g1 are no longer there. Test 3 - Both latest master and 3.6 Log in as the Admin. Create a course. Enrol students in the course. Create a group g1 in the course and make sure to enable 'Group messaging'. Create a group g2 in the course and make sure to enable 'Group messaging'. Add a student s1 to both groups. Log in as s1 in another browser and open the messaging panel. You should be able to see the groups g1 and g2. As the admin go back to the course's groups page and delete g1. Back on s1's window, refresh the page. Open the messaging panel. Confirm you can only see the group conversation for g2.
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-64568_master

      Description

      To reproduce:

      1. Create a course
      2. Enrol students in the course.
      3. Create a group g1 in the course and make sure to enable Group messaging
      4. Add a student s1 to the group.
      5. On an incognito browser, log in as s1 and open the messaging panel.
      6. You should be able to see the group g1.
      7. Back on the course's groups page, delete g1.
      8. Back on s1's window, refresh the page.
      9. Open the messaging panel.
      10. Expected: The group conversation for g1 should have disappeared (e.g. deleted from the database too or hidden/deactivated at the least.
      11. Actual: The group conversation for the deleted group is still shown.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 week
                  1w
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours Time Not Required
                  5h