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

Recycle Bin - deleting large complex objects forces user to wait

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Manual tests

      Installation and upgrade tests

      1. Perform a fresh install (MDK) and confirm that the 'deletioninprogress' flag is present on the course_modules table.
      2. Perform an upgrade from 31 and confirm that the 'deletioninprogress' flag has been added to the course_modules table.

      Course module deletion

      Set up (course creation)

      1. Create a new course with the following course format settings:
        • Format = topics
        • Number of sections = 10
        • Hidden sections = 'Hidden sections are shown in collapsed form'
        • Course layout = 'Show all sections on one page'

      Testing course module deletion (adding to recycle bin)

      1. From within the course, enable editing
      2. In the first course section (topic 1, not 0), create one of every activity/resource.
      3. For each activity/resource:
        • Delete the module by clicking Edit > Delete from the context menu and confirm.
        • Confirm that the module is removed from the section
        • Run the cron task from the webroot: php admin/cli/cron.php.
        • Check the course logs (Course > Reports > Logs) and ensure that the course module deleted events belong to the user you was logged in as
        • Click the recycle bin (if it's the first module you deleted, you may need to reload the page to see it).
        • Confirm that the module is listed with options to restore and delete
        • Return to the course main page
        • Confirm that the module is no longer listed under Topic 1 in the Nav block.

      Testing course module restore from recycle bin

      1. For each activity/resource in the recycle bin:
        • Click restore and when complete, click 'Back to course'
        • Confirm that you see the activity/resource under Topic 1.

      Testing permanent deletion from recycle bin

      1. For each activity/resource in Topic 1 (this should still contain the full set of activities/resources you created earlier):
        • Delete the module
      2. Now, run the cron task to add all modules to the recycle bin (only need to run once)
      3. Reload the page (you'll need to do this is the recycle bin is empty and thus hidden)
      4. Again for each module in the recycle bin:
        • Click Delete and confirm the action
        • Confirm that you see a notification stating the module was successfully removed

      Course section deletion (topics format)

      This next section will cover section removal/addition, reordering/renaming and restoring from recycle bin, and will cover actions made between the point of deletion, and the point at which the adhoc task runs.

      Testing course section deletion

      1. Continuing in the same course, add 2 activities to a topic in the middle (not Topic 1 or 10)
      2. Delete the section/topic by clicking Edit > Delete from the context menu and confirm. Remember the topic number
      3. Confirm that the section is removed from the page, and that its activities are not visible anywhere else (in an orphaned section for example)
      4. Confirm that the topic names have been adjusted and are in the correct order. I.e. Topic 1 through Topic 9

      Adding/removing sections while deletion is pending

      1. On the course home page, click the plus(+) symbol to add a new section
      2. Confirm that the new section is visible and that the section ordering is correct (Topics 1 through 10 again)
      3. Click the minus(-) symbol to reduce the number of sections
      4. Confirm that the Topic 10 is no longer visible
      5. Add an activity to the last section (Topic 9)
      6. Click the minus(-) symbol to reduce the number of sections
      7. Confirm that you see an 'Orphaned activity (Section 9)' section
      8. Click the plus(+) symbol to increase the number of sections
      9. Confirm that the orphaned section is now displayed as a normal section (Topic 9) and that it includes the activity still.
      10. Try adding/reducing the number of sections from the course settings page and confirm that this behaves the same as reducing the number using the minus/plus method above.

      Section swapping while deletion is pending

      1. Move an existing topic to the last position
      2. Confirm that the topic numbering is correct
      3. Repeat for different sections and confirm the Topic numbers are updated correctly after moving

      Moving the pending section into the recycle bin

      1. Run the cron task
      2. Click the recycle bin (if it's the first section you deleted, you may need to reload the page to see it).
      3. Confirm that the 2 activities from the deleted section are listed

      Testing restore to course section

      1. On the course home page, click the plus(+) symbol below the last section to add a new section
      2. Confirm that the total number of sections is now 10 and that the sections are correctly ordered
      3. Click the recycle bin
      4. For each activity:
        • Click restore for the activity you deleted in the last step
        • Confirm that the recycle bin no longer lists the item
      5. Click 'return to course'
      6. Confirm that the activities have been restored to section 0 of the course.

      Repeat the above 5 tests(section deletion tests) but with the removal of Topic 1 and Topic 10 (first and last) to cover edge cases

      Course section deletion (weekly format)

      1. Create a new course with weekly format and run through all the topics format tests above (all tests under the 'Course section deletion (topics format)' heading), replacing 'Topic x' with the relevant date range. Also make sure to test deletion of weeks at the beginning and end of the sections so edge cases are tested.

      Module-then-section deletion

      1. First, run cron to make sure all adhocs have been run.
      2. Make a new section in the course and add an activity.
      3. From the course home, delete the activity but don't run the cron task
      4. Now, delete the empty section
      5. Run the cron task and confirm that no errors occur.
      6. Click the recyclebin and Confirm that the activity has been added and that there is only one.

      Gradebook

      1. Make sure you have at least one activity somewhere in the course. Remember the name.
      2. Run cron to make sure all adhocs have been run.
      3. Check the gradebook pages (gradebook setup, reports etc) and Confirm that no warning notification is present on the pages.
      4. Click 'Grader report'
      5. Turn editing on
      6. Confirm that you can edit the grades inline for your activity from (1)
      7. Now, go back to course home page and delete the activity, but don't run the cron task.
      8. Now, check the gradebook pages again. Confirm that you see the 'Activity deletion in progres' warning. Check all pages in the menu.
      9. Click the grader report again and enable editing (if not already enabled)
      10. Confirm that:
        • The activity you just deleted is still listed, but with a '[Deletion in progress] ' string prepended to its name.
        • You can't inline-edit the grades for this activity (grade items are locked)
      11. Now, run the cron task.
      12. Refresh the page and Confirm that:
        • You no longer see the warning notification on the page.
        • You no longer see the activity listed in the grader report.
      13. Click a few other gradebook pages and confirm the same.

      Availability

      1. First, make sure you have course completion tracking enabled on the site and course.
      2. Make sure you have an activity somewhere in the course.
      3. Make sure this activity has activity completion set to 'Student can manually complete...'
      4. Run cron to make sure all adhocs have been run.
      5. Delete the activity but don't run the cron task
      6. Create a new activity and scroll to the 'Restrictions' section of the form.
      7. Try adding a restriction based on grades and Confirm that you can't see the activity you just deleted.
      8. Try adding a restriction based on completion and Confirm that you can't see the activity you just deleted.

      Badges

      1. First, make sure you have course completion tracking enabled on the site and course.
      2. Make sure you have badges enabled.
      3. Make sure you have an activity somewhere in the course.
      4. Make sure this activity has activity completion set to 'Student can manually complete...'
      5. Run cron to make sure all adhocs have been run.
      6. Delete the activity but don't run the cron task
      7. Add a new badge to the course.
      8. Click Manage badges and view the 'Criteria' tab
      9. Select 'activity completion' from the drop down
      10. Confirm that you don't see the activity you just deleted in the list.

      Course completion overview

      1. First, make sure you have course completion tracking enabled on the site and course.
      2. Make sure you have badges enabled.
      3. Make sure you have an activity somewhere in the course.
      4. Make sure this activity has activity completion set to 'Student can manually complete...'
      5. Run cron to make sure all adhocs have been run.
      6. Delete the activity but don't run the cron task
      7. Under course admin, click 'Course completion'
      8. Under 'Condition: Activity completion', Confirm that you don't see the activity you just deleted.

      Calendar

      1. First, make sure you have course completion tracking enabled on the site and course.
      2. Make sure you have badges enabled.
      3. Make sure you have an activity somewhere in the course.
      4. Make sure this activity has activity completion set to 'Student can manually complete...'
      5. Run cron to make sure all adhocs have been run.
      6. Delete the activity but don't run the cron task
      7. Check the calendar and confirm that the activity you just deleted is not present.
      Show
      Manual tests Installation and upgrade tests Perform a fresh install (MDK) and confirm that the 'deletioninprogress' flag is present on the course_modules table. Perform an upgrade from 31 and confirm that the 'deletioninprogress' flag has been added to the course_modules table. Course module deletion Set up (course creation) Create a new course with the following course format settings: Format = topics Number of sections = 10 Hidden sections = 'Hidden sections are shown in collapsed form' Course layout = 'Show all sections on one page' Testing course module deletion (adding to recycle bin) From within the course, enable editing In the first course section (topic 1, not 0), create one of every activity/resource. For each activity/resource: Delete the module by clicking Edit > Delete from the context menu and confirm. Confirm that the module is removed from the section Run the cron task from the webroot: php admin/cli/cron.php . Check the course logs (Course > Reports > Logs) and ensure that the course module deleted events belong to the user you was logged in as Click the recycle bin (if it's the first module you deleted, you may need to reload the page to see it). Confirm that the module is listed with options to restore and delete Return to the course main page Confirm that the module is no longer listed under Topic 1 in the Nav block. Testing course module restore from recycle bin For each activity/resource in the recycle bin: Click restore and when complete, click 'Back to course' Confirm that you see the activity/resource under Topic 1. Testing permanent deletion from recycle bin For each activity/resource in Topic 1 (this should still contain the full set of activities/resources you created earlier): Delete the module Now, run the cron task to add all modules to the recycle bin (only need to run once) Reload the page (you'll need to do this is the recycle bin is empty and thus hidden) Again for each module in the recycle bin: Click Delete and confirm the action Confirm that you see a notification stating the module was successfully removed Course section deletion (topics format) This next section will cover section removal/addition, reordering/renaming and restoring from recycle bin, and will cover actions made between the point of deletion, and the point at which the adhoc task runs. Testing course section deletion Continuing in the same course, add 2 activities to a topic in the middle (not Topic 1 or 10) Delete the section/topic by clicking Edit > Delete from the context menu and confirm. Remember the topic number Confirm that the section is removed from the page, and that its activities are not visible anywhere else (in an orphaned section for example) Confirm that the topic names have been adjusted and are in the correct order. I.e. Topic 1 through Topic 9 Adding/removing sections while deletion is pending On the course home page, click the plus(+) symbol to add a new section Confirm that the new section is visible and that the section ordering is correct (Topics 1 through 10 again) Click the minus(-) symbol to reduce the number of sections Confirm that the Topic 10 is no longer visible Add an activity to the last section (Topic 9) Click the minus(-) symbol to reduce the number of sections Confirm that you see an 'Orphaned activity (Section 9)' section Click the plus(+) symbol to increase the number of sections Confirm that the orphaned section is now displayed as a normal section (Topic 9) and that it includes the activity still. Try adding/reducing the number of sections from the course settings page and confirm that this behaves the same as reducing the number using the minus/plus method above. Section swapping while deletion is pending Move an existing topic to the last position Confirm that the topic numbering is correct Repeat for different sections and confirm the Topic numbers are updated correctly after moving Moving the pending section into the recycle bin Run the cron task Click the recycle bin (if it's the first section you deleted, you may need to reload the page to see it). Confirm that the 2 activities from the deleted section are listed Testing restore to course section On the course home page, click the plus(+) symbol below the last section to add a new section Confirm that the total number of sections is now 10 and that the sections are correctly ordered Click the recycle bin For each activity: Click restore for the activity you deleted in the last step Confirm that the recycle bin no longer lists the item Click 'return to course' Confirm that the activities have been restored to section 0 of the course. Repeat the above 5 tests(section deletion tests) but with the removal of Topic 1 and Topic 10 (first and last) to cover edge cases Course section deletion (weekly format) Create a new course with weekly format and run through all the topics format tests above (all tests under the 'Course section deletion (topics format)' heading), replacing 'Topic x' with the relevant date range. Also make sure to test deletion of weeks at the beginning and end of the sections so edge cases are tested. Module-then-section deletion First, run cron to make sure all adhocs have been run. Make a new section in the course and add an activity. From the course home, delete the activity but don't run the cron task Now, delete the empty section Run the cron task and confirm that no errors occur. Click the recyclebin and Confirm that the activity has been added and that there is only one. Gradebook Make sure you have at least one activity somewhere in the course. Remember the name. Run cron to make sure all adhocs have been run. Check the gradebook pages (gradebook setup, reports etc) and Confirm that no warning notification is present on the pages. Click 'Grader report' Turn editing on Confirm that you can edit the grades inline for your activity from (1) Now, go back to course home page and delete the activity, but don't run the cron task. Now, check the gradebook pages again. Confirm that you see the 'Activity deletion in progres' warning. Check all pages in the menu. Click the grader report again and enable editing (if not already enabled) Confirm that: The activity you just deleted is still listed, but with a '[Deletion in progress] ' string prepended to its name. You can't inline-edit the grades for this activity (grade items are locked) Now, run the cron task. Refresh the page and Confirm that: You no longer see the warning notification on the page. You no longer see the activity listed in the grader report. Click a few other gradebook pages and confirm the same. Availability First, make sure you have course completion tracking enabled on the site and course. Make sure you have an activity somewhere in the course. Make sure this activity has activity completion set to 'Student can manually complete...' Run cron to make sure all adhocs have been run. Delete the activity but don't run the cron task Create a new activity and scroll to the 'Restrictions' section of the form. Try adding a restriction based on grades and Confirm that you can't see the activity you just deleted. Try adding a restriction based on completion and Confirm that you can't see the activity you just deleted. Badges First, make sure you have course completion tracking enabled on the site and course. Make sure you have badges enabled. Make sure you have an activity somewhere in the course. Make sure this activity has activity completion set to 'Student can manually complete...' Run cron to make sure all adhocs have been run. Delete the activity but don't run the cron task Add a new badge to the course. Click Manage badges and view the 'Criteria' tab Select 'activity completion' from the drop down Confirm that you don't see the activity you just deleted in the list. Course completion overview First, make sure you have course completion tracking enabled on the site and course. Make sure you have badges enabled. Make sure you have an activity somewhere in the course. Make sure this activity has activity completion set to 'Student can manually complete...' Run cron to make sure all adhocs have been run. Delete the activity but don't run the cron task Under course admin, click 'Course completion' Under 'Condition: Activity completion', Confirm that you don't see the activity you just deleted. Calendar First, make sure you have course completion tracking enabled on the site and course. Make sure you have badges enabled. Make sure you have an activity somewhere in the course. Make sure this activity has activity completion set to 'Student can manually complete...' Run cron to make sure all adhocs have been run. Delete the activity but don't run the cron task Check the calendar and confirm that the activity you just deleted is not present.
    • Difficulty:
      Difficult
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-54751-master-v5
    • Story Points:
      5
    • Sprint:
      3.2 Sprint 7

      Description

      With the recycle bin enabled, deleting large, complex objects forces the user to wait until the backup process has completed before they can do anything else. When you delete small objects (e.g., labels, simple pages), the deletion occurs quickly. By "deletion," I mean this workflow:

      1. Turn editing on
      2. Delete item
      3. Turn editing off

      But when you delete a larger, complex object, step 3 above – turning editing off – can take a long time ( up to > 2 minutes), and there is no indication (other than what the browser provides) that something is happening. You basically have to wait for it to finish. Something that used to happen immediately – turning editing off after deleting something (regardless of its complexity) – can take minutes with the Recycle Bin enabled. An example of a "large, complex object" is a quiz with 95 questions and 155 student responses. Obviously, Moodle is working on backing up the quiz, and since it's rather complex (lots of responses), it takes time. The same thing happens on restore. Restoring this kind of quiz can take some time, but there isn't any kind of progress indicator to let the user know that something is happening and that it may take some time.

      The concern here is that with the recycle bin enabled, a fundamental aspect of the Moodle experience has changed; i.e., deleting some objects no longer happens quickly if they are complex. How long it takes for Moodle to return control when turning editing back off after deleting an object depends on how large/complex that object is. And Moodle provides no progress indicator that something is happening.

      We also saw this behavior when testing the recycle bin plugin our Moodle 2.7 site (we also saw session lock errors for large object deletions). We also see this issue on a test Moodle 3.1 server with the recycle bin enabled. While this quiz example may represent an outlier, users delete all sort of things... small and large objects.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                12 Vote for this issue
                Watchers:
                24 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16