kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Content/Channel Deletion Task: `force_delete` not forcing deletion

Open nucleogenesis opened this issue 1 year ago • 2 comments

Observed behavior

  • Have two channels imported into Kolibri which share resources. (ie, create a new Studio channel, copy-paste content from another channel to it, publish your channel, import it along w/ the channel you copy-pasted from).
  • Go through process of deleting a resource from one of those channels, click the "delete from all other locations" checkbox on the "Delete" modal
  • See that the resource is successfully deleted from the channel where you did the deletion, but it remains in your other channel nonetheless.

https://github.com/user-attachments/assets/37436df2-ff75-44bc-9664-08a9202dcb16

Errors and logs

The task creation API request payload:

{
    "type": "kolibri.core.content.tasks.deletechannel",
    "channel_id": "737804b26629425284ef48fa1b1e1bde",
    "channel_name": "Jacob Test 1",
    "node_ids": [
        "68a05f33789a43a5b6b1d47e287eb2b9"
    ],
    "exclude_node_ids": [],
    "force_delete": true  // This is what should be ensuring that the content is deleted everywhere
}

The response:

{
    "status": "QUEUED",
    "type": "kolibri.core.content.tasks.deletechannel",
    "exception": null,
    "traceback": "",
    "percentage": 0,
    "id": "c4534149d8f54317938dabf7a8109395",
    "cancellable": false,
    "clearable": false,
    "facility_id": null,
    "args": [
        "737804b26629425284ef48fa1b1e1bde"
    ],
    "kwargs": {
        "node_ids": [
            "68a05f33789a43a5b6b1d47e287eb2b9"
        ],
        "exclude_node_ids": []
    },
    "extra_metadata": {
        "channel_name": "Jacob Test 1",
        "channel_id": "737804b26629425284ef48fa1b1e1bde",
        "started_by": "cc3dfc1f3003400add64f62807186afc",
        "started_by_username": "a"
    },
    "scheduled_datetime": "2024-08-26T22:07:43.467447+00:00",
    "repeat": 0,
    "repeat_interval": 0,
    "retry_interval": null
}

Expected behavior

Clicking the "remove from everywhere" checkbox should result in the content being removed from all channels in which it has been imported.

More like - when force_delete is sent when creating the deletechannel task, it should remove that content from all channels.

User-facing consequences

User is given an option which doesn't do anything when selected.

Context

Found while fixing regression causing the checkbox itself not to toggle when clicked (#12589) -- but that is unrelated to this particular issue, just how I stumbled across it.

  • Kolibri release-v0.17.x devserver
  • Fedora 40
  • Chromium

nucleogenesis avatar Aug 26 '24 22:08 nucleogenesis

Hi, I am happy to take this issue

thesujai avatar Sep 16 '24 15:09 thesujai

I've assigned you @thesujai - thanks for taking this on!

nucleogenesis avatar Sep 16 '24 15:09 nucleogenesis

Fixed in #12680

rtibbles avatar Oct 23 '24 17:10 rtibbles